Contents of a bookmark
Contents of a bookmark
(OP)
I don't know how to watch the bookmark contents on the screen. I have typed the following:
dim lbookmark as string
If ActiveDocument.Bookmarks.Exists("BMK_Phone1") = True Then
ActiveDocument.Bookmarks("BMK_Phone1").Range.Text = "Pepe"
End If
lbookmark = ActiveDocument.Bookmarks("BMK_Phone1").Range.Text
If ActiveDocument.Bookmarks("BMK_Phone1").Range.Text = "Pepe" Then
Msgx = "Phone1 value is Pepe"
Tit = "Warning"
rc = MsgBox(Msgx, vbOKOnly, Tit)
Else
Msgx = "Phone1 value is " & lbookmark
Tit = "Warning"
rc = MsgBox(Msgx, vbOKOnly, Tit)
End If
The result after running this lines is lbookmark="" instead of Pepe and I don't know why. Anyone knows what's the problem?
Thank you very much.
dim lbookmark as string
If ActiveDocument.Bookmarks.Exists("BMK_Phone1") = True Then
ActiveDocument.Bookmarks("BMK_Phone1").Range.Text = "Pepe"
End If
lbookmark = ActiveDocument.Bookmarks("BMK_Phone1").Range.Text
If ActiveDocument.Bookmarks("BMK_Phone1").Range.Text = "Pepe" Then
Msgx = "Phone1 value is Pepe"
Tit = "Warning"
rc = MsgBox(Msgx, vbOKOnly, Tit)
Else
Msgx = "Phone1 value is " & lbookmark
Tit = "Warning"
rc = MsgBox(Msgx, vbOKOnly, Tit)
End If
The result after running this lines is lbookmark="" instead of Pepe and I don't know why. Anyone knows what's the problem?
Thank you very much.





RE: Contents of a bookmark
If ActiveDocument.Bookmarks("BMK_Phone1").Exists=True Then
RE: Contents of a bookmark
Cyril Guichard
Mechanical Engineer