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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top