Bookmark

Q

Quantum

What is wrong with this? What is the proper syntax for inserting text into
the bookmark?

Private Sub OptionButton1_Click()
ActiveDocument.Bookmarks(Cholesterol).Range.InsertAfter "your cholesterol is
fine."


End Sub
 
D

Dave Lett

Hi,

You need quotation marks around the name of your bookmark:

ActiveDocument.Bookmarks("Cholesterol").Range.InsertAfter "your cholesterol
is fine."


HTH,
Dave
 
J

Jonathan West

Quantum said:
What is wrong with this? What is the proper syntax for inserting text into
the bookmark?

Private Sub OptionButton1_Click()
ActiveDocument.Bookmarks(Cholesterol).Range.InsertAfter "your cholesterol
is
fine."


End Sub

if the bookmark is named Cholesterol, then you need to put quotes round the
name
 
J

Jezebel

Apart from the issue with quoting the name, your instruction is inserting
your text AFTER the bookmark, not into it. Is that what you intend?
 
Top