View Single Post
  #15   Report Post  
Posted to microsoft.public.word.docmanagement
Jane
 
Posts: n/a
Default Repeating same text in the same doc

Hi,

Thanks, all is now well with the userform and bookmarked fields. However,
there are a few times when I repeat one of the fields. I have:

1. Created a bookmark called "Company_Name" and inserted it at one point in
the template document. This works without any problem.
2. Clicked Insert Field Ref and selected the bookmark "Company_Name".

However, the information that appears where I have inserted the original
bookmark is not visible in the places where I have inserted the ref field.

How to I overcome this?

Jane


"Greg Maxey" wrote:

1. Yes you presume correctly. What inverted commas?
2. Just remove the underscore and use somethimg like this all on one line:

..Bookmarks("Text1").Range.InsertBefore TextBox1

You would repeat this for each additional Bookmark that you want to assign
text from a Userform field. If you are simply repeating the same data at
various locations then just use one Userform textbox and one bookmark. Then
use REF fields for the other locations.

3. It means ActiveDocument and that is what you type.
4. See 2. above
5. If you type the data statement out as one line, after you type Range.
then the InsertBefore should appear in the list.
6. You assume correctly
7. You can shift back between the code view and object view of the form if
you want to see the control names.

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.


Jane wrote:
Hi,

I've used the information contained at this hyperlink. However, when
I am at step 10, I am confused. I don't know VBA, and am only
following your directions.

1. I presume where the "Text1" and "Text2" is written that I use the
names I have assigned to the text boxes? Do I use the inverted
commas?
2. Where it says Range_, what goes after the underscore? I've read
about the Range command and I think it means for me to indicate the
section of the document to which the bookmark applies. My bookmarks
appy throughout my document.
3. Where it says ActiveDocument, do I type ActiveDocument, or does
that mean I enter the name of my Word document?
4. It says "Repeat the lines beginning with .Bookmarks for each
bookmark". Am I supposed to repeat the line beginning .InsertBefore
for each bookmark?
5. On the line starting with .InsertBefore, am I supposed to be able
to select "InsertBefore" from the drop down menu that appears? It
doesn't seem to be there.
6. On the line starting with.InsertBefore, where it refers to TextBox
1, I presume I am to include the names I have given each text box.
Is there a way to access the names of my textboxes rather than write
them all down?

Thanks,

Jane

"Greg" wrote:

See:
http://gregmaxey.mvps.org/Repeating_Data.htm