Fernand Vanrie wrote: >>> >> As a follow-up to my previous message, I can see that >> oCell=oSheet.getCellByposition(0,0) 'A1 >> and then >> oCell.CharWeight = com.sun.star.awt.FontWeight.BOLD >> should make the contents of oCell bold. What I don't understand is how to >> make a substring of oCell >> Position = InStr(oCell.getString(), ".") >> Mid(oCell.getString(), 1, Position - 1) >> bold. I just want the substring starting from position 1 and stopping >> before a fullstop. That's what I want bold but I don't know how to refer >> to that substring so I can give it a CharWeight attribute. >> > ok: I supose you need TextRanges and therefore you need a Viewcursor or > a TextCursor to select this Ranges who can tgakes different formating > > i found in the same gimmicks section > > Sub InsertStringToCell(sCellString as String, oCell as Object, > sCellStyle as String) > Dim oCellCursor as Object > oCellCursor = oCell.CreateTextCursor() > oCellCursor.CharStyleName = sCellStyle > oCell.Text.insertString(oCellCursor,sCellString,False) > oDocument.CurrentController.Select(oCellCursor) > End Sub >> I hope this is clearer. >> Jonathan >> Sorry Fernand, I don't follow this at all. I'm not trying to insert a new string into a cell but rather modify the existing content of a cell. Suppose the original content of the cell is "abcd.efg". I want to write a subroutine that will scan the cell contents up to the fullstop and format that as bold and concatenate the result to the remaining part of the string. So the output should be "abcd" in bold and then ".efg" in non-bold. I don't see how InsertStringToCell helps me because the content of what I am using is based on the original content of the cell (except that I change that to bold). I apologise for not being clear but I don't know how else to express this. Thanks for your patience. Jonathan -- Registerd Linux user #445917 at http://counter.li.org/ Please do not send me copies of list mail. I read the lists. Thanks!
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
