Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing text in word bookmark

Status
Not open for further replies.

WindmillChaser

Technical User
Dec 27, 2005
3
US
I have an application where I fill in the values of the bookmarks in a word template. I need to loop a file to add up the quantity. At I loop the assigned the value to the bookmark,

objDoc.Bookmarks("Quantity").Range.Text = Qty1

When it loop comes around it is assigned the new value

objDoc.Bookmarks("Quantity").Range.Text = Qty2

However, when this is printed on the document I see, Qty1Qty2. I had expected Qty2 to overwrite Qty1.

When I look at the value of the bookmark after the first loop, it shows nothing. This again is unexpected for me.

What is the proper way to do this?

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top