else:\r
moveFunc=self._rangeObj.Move\r
res=moveFunc(unit,direction)\r
+ #units higher than character and word expand to contain the last text plus the insertion point offset in the document\r
+ #However move from a character before will incorrectly move to this offset which makes move/expand contridictory to each other\r
+ #Make sure that move fails if it lands on the final offset but the unit is bigger than character/word\r
+ if direction>0 and unit not in (wdCharacter,wdWord) and (self._rangeObj.start+1)==self.obj.WinwordDocumentObject.characters.count:\r
+ return 0\r
return res\r
\r
def _get_bookmark(self):\r