V
VinceB1
hello there i want to loop through bookmarks named com1 to com8 until finding
the first bookmark with nothing in it and then go to the previous bookmark.
so for example com1 to com3 have details in them but com4 does not search
through the bookmarks find the first one with nothing in "com4" and then
print the details in the previous bookmark.
so far i have
Const BOOKMARK_LABEL As String = "Com"
Const BOOKMARK_CON As String = ""
nPosition = 0
For Each oBookmark In ActiveDocument.Bookmarks
If InStr(1, oBookmark.Name, BOOKMARK_LABEL, vbTextCompare) =
1 Then
nPosition = nPosition + 1
If oBookmark.Range = BOOKMARK_CON Then nPosition =
nPosition - 1
Call WriteProp(sPropName:="Comments", sValue:="i hate
this")
Else: Call WriteProp(sPropName:="Comments", sValue:
=oBookmark.Name)
'Else: Call WriteProp(sPropName:="Comments", sValue:
=oBookmark.Name)
End If
Next oBookmark
i know its miles away but ive confused myself to the point of not knowing
what i'm doing. thanks
the first bookmark with nothing in it and then go to the previous bookmark.
so for example com1 to com3 have details in them but com4 does not search
through the bookmarks find the first one with nothing in "com4" and then
print the details in the previous bookmark.
so far i have
Const BOOKMARK_LABEL As String = "Com"
Const BOOKMARK_CON As String = ""
nPosition = 0
For Each oBookmark In ActiveDocument.Bookmarks
If InStr(1, oBookmark.Name, BOOKMARK_LABEL, vbTextCompare) =
1 Then
nPosition = nPosition + 1
If oBookmark.Range = BOOKMARK_CON Then nPosition =
nPosition - 1
Call WriteProp(sPropName:="Comments", sValue:="i hate
this")
Else: Call WriteProp(sPropName:="Comments", sValue:
=oBookmark.Name)
'Else: Call WriteProp(sPropName:="Comments", sValue:
=oBookmark.Name)
End If
Next oBookmark
i know its miles away but ive confused myself to the point of not knowing
what i'm doing. thanks