Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Bookmarks
I've a template containing bookmarks and I've created a UserForm to populate
the bookmarked areas of the template. I've also cross-referenced the bookmarks. Unfortunately, the information is replacing the bookmarks so the cross-references don't work. How do I stop the bookmarks from being deleted? Thanks for any help and assistance you can give me. |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Bookmarks
Hi Noella,
If your text goes into a formfield on the document, try something based on: Sub UpdateBookmark (BmkNm as string, MyTxt as string) If ActiveDocument.Bookmarks.Exists(BmkNm) Then ActiveDocument.Bookmarks(BmkNm).Range.Fields(1).Re sult.Text = MyTxt End if End sub where BmkNm and MyTxt are variables holding your bookmark name and text, respectively. Otherwise, if you're just populating stanadard bookmarks, try: Sub UpdateBookmark (BmkNm as string, MyTxt as string) Dim BmkRng as Range If ActiveDocument.Bookmarks.Exists(BmkNm) Then Set BmkRng = ActiveDocument.Bookmarks(BmkNm).Range BmkRng.Text = MyTxt ActiveDocument.Bookmarks.Add BmkNm, BmkRng End if Set BmkRng = Nothing End sub where BmkNm and MyTxt are variables holding your bookmark name and text, respectively. Cheers -- macropod [MVP - Microsoft Word] ------------------------- "Noella" wrote in message ... I've a template containing bookmarks and I've created a UserForm to populate the bookmarked areas of the template. I've also cross-referenced the bookmarks. Unfortunately, the information is replacing the bookmarks so the cross-references don't work. How do I stop the bookmarks from being deleted? Thanks for any help and assistance you can give me. |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Word 2007 bookmarks - How to display bookmarks on page? | Microsoft Word Help | |||
Bookmarks | Microsoft Word Help | |||
bookmarks | Microsoft Word Help | |||
Bookmarks.. how do you know where they are exactly??? | Microsoft Word Help | |||
Bookmarks | Tables |