Bookmarks in document

J

Jim

Hi,
I am a newbie...I started a project and have a document called W2SMT saved
as a template and want to create a userform after this.
PROBLEM is I have several places to enter the date, name, etc throughout
the W2smt document template. I inserted the first of 4 bmkDate bookmarks
and the 1st looked normal with the large "I" on the line as it is supposed
to look, however, on each additional line requiring the date when I inserted
bmkDate, the previous bookmarks were no longer visible. Only the last (4th
one) bmkDate had the large symbol "I" as the bookmark. Each time I inserted
bmkDate, it made the previous bmkDate symbol disappear.
Is this normal not to see the bookmark symbol "I" or did I lose the 1st,
2nd, 3rd bookmarks named bmkDate?? Can I do what I am attempting to do or
how must I handle it.
See, told you I am a beginner..Thanks in advance,
Jim
 
J

Jay Freedman

Jim said:
Hi,
I am a newbie...I started a project and have a document called W2SMT saved
as a template and want to create a userform after this.
PROBLEM is I have several places to enter the date, name, etc throughout
the W2smt document template. I inserted the first of 4 bmkDate bookmarks
and the 1st looked normal with the large "I" on the line as it is supposed
to look, however, on each additional line requiring the date when I inserted
bmkDate, the previous bookmarks were no longer visible. Only the last (4th
one) bmkDate had the large symbol "I" as the bookmark. Each time I inserted
bmkDate, it made the previous bmkDate symbol disappear.
Is this normal not to see the bookmark symbol "I" or did I lose the 1st,
2nd, 3rd bookmarks named bmkDate?? Can I do what I am attempting to do or
how must I handle it.
See, told you I am a beginner..Thanks in advance,
Jim

Hi, Jim,

A bookmark name can be used at most once anywhere in a document. If
you try to create a second bookmark with the same name, Word assumes
that you're redefining the location of the same bookmark -- it removes
it from the previous location as it creates it in the new location.

If you're repeating the same information in several places, there are
a couple of ways to go about it.

One way is to use distinct unique bookmark names, possibly by tacking
on numbers to make bmkDate1, bmkDate2, bmkDate3, and bmkDate4. Then
your macro can insert the date in each place, using code like this:

Dim indx As Integer
For indx = 1 To 4
ActiveDocument.Bookmarks("bmkDate" & indx) _
.Range.Text = Format(Date, "MMMM dd, yyyy")
Next indx

Notice how the value of the indx counter is attached to the root word
"bmkDate" to make the name of a specific numbered bookmark.

The other way, which is probably better if the document will be
updated later, is to place just one bookmark in the document for each
piece of information, and have the macro fill that one with the
required text. In each of the other locations, place a REF field that
refers to the bookmark. The macro should also include

ActiveDocument.Fields.Update

to update all the REF fields after the bookmark is filled.
 

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