Hi Hal, Message de Hal Vaughan date 2009-06-26 08:41 :
Sub InsertAutoMacroTextoDoc = ThisComponent oCurs = oDoc.getCurrentController().getViewCursor() iEnd = false iCount = 0 Do'Go back one character, then get that character and put it in a separate variable'for comparison. oCurs.goLeft(1, true) sKey = oCurs.getString() sChar = Left(sKey, 1)'BUG: This next line throws an error if we try to use this at the start of a document.
Methods goLeft and goRight return a boolean True if the move could be done, False if it failed.
if oCurs.goLeft(1, True) then ' do your job else ' already at start of text end Regards Bernard --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
