![]() |
|
#6
|
||||
|
||||
|
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"
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 |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Replicating Insert Hyperlink-Bookmark function | Marrick13 | Word VBA | 0 | 02-05-2016 01:27 PM |
Is there anyway I can insert an easy bookmark in word?
|
BayhDole | Word | 2 | 07-21-2015 08:43 PM |
Open header to insert text into bookmark
|
Amapola188 | Word VBA | 3 | 07-12-2012 05:16 PM |
Word 2003 - IncludeText Does Not Include Bookmark Text if in a Form Text Control
|
skarden | Word | 1 | 12-12-2011 10:39 PM |
VBA to insert Bookmark
|
rockwellsba | Word VBA | 2 | 05-31-2011 01:07 AM |