View Single Post
 
Old 06-04-2017, 04:06 AM
DavidTheToad DavidTheToad is offline Windows XP Office 2007
Novice
 
Join Date: Nov 2013
Posts: 15
DavidTheToad is on a distinguished road
Default Inserting a bookmark

My macro chooses a number of extracts from a large document, each extract is 30 words long. It writes them on a second document. All this works fine.

I now want to add a bookmark at the start of each extract. I have taken an example from the microsoft library so that the relevant parts of the code are

Code:
For n = 1 to 10   ' Number of extracts
bkmk="bm" & n
z=Rnd
mx=(upperbound - lowerbound +1)*Rnd + lowerbound
m=Int(mx)
sorsDoc.Words(m).Bookmarks.Add Name:="bkmk" 
'The above from https://msdn.microsoft.com/en-us/library/office/ff197253.aspx
[Some other instructions]
next   'Next n
The problem is that when I come to look at sorsDoc after the macro has run, I can only see a single bookmark instead of ten of them.
Reply With Quote