View Single Post
 
Old 05-19-2016, 05:29 AM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,144
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

OK I see what you mean. The following should address it.

Code:
Dim oRng As Range
Dim oOriginal As Range
    Set oOriginal = ActiveDocument.Bookmarks("MybookmarkName").Range
    Set oRng = ActiveDocument.Bookmarks("MybookmarkName").Range
    oRng.Collapse 1
    oRng.Text = "toto"
    oOriginal.start = oRng.End
    oOriginal.Bookmarks.Add "MybookmarkName"
or alternatively
Code:
Dim oRng As Range
Dim oOriginal As Range
Dim sText As String: sText = "toto"
    Set oRng = ActiveDocument.Bookmarks("MybookmarkName").Range
    oRng.InsertBefore sText
    oRng.MoveStart Count:=Len(sText)
    oRng.Bookmarks.Add "MybookmarkName"
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote