macro for copy/paste

G

Geri

I have Word2000. I have created a form/letter, I type in
a word, and I know I need that same word later. I want
to create a macro that will copy what I just typed and go
down to a specific place in the form and paste it. I can
do this easily with copy and paste, but it is repetitive,
so would like to do a macro. The first word is typed in
a "field" created in the document automation. It is the
name of the subject of the letter. I will be repeating
the name 4 lines down in another field. Seems like I
could get Word to do this for me, but when I try to
record a Macro, I cannot highlight text to copy it.
Thanks for any help. I am a real newbie, not a
programmer at all, just an office person trying to get
Word to help me out with repetitive tasks. Geri
 
D

Doug Robbins - Word MVP

Hi Geri,

I am not sure exactly what you mean by " a "field" created in the document
automation" If that is a formfield that has a bookmark name assigned to it,
you can use a cross reference to the text of the bookmark in the other
locations where you want the information to appear. If you can get the
document automation to create a document variable, you can use a {
DOCVARIABLE } field in the other locations.

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
G

Geri

I think it is called a fillin field. I created it by
Insert Field, DocAutomation, Macro, then I type NOMACRO
and a word that is a reminder of what the field is for.
I don't know how to bookmark it. I don't know how to do
document variables, and not sure where to go to get the
help. Geri
 
D

Doug Robbins - Word MVP

Hi Geri,

The fields under the Document Automation category are Compare, DocVariable,
GoToButton, If, MacroButton and Print.

Fillin is under the Mail Merge category and I would avoid it like the
plaque.

Better to get really into Document Automation and use a userform.

See the article "How to create a Userform" at:

http://www.mvps.org/word/FAQs/Userforms/CreateAUserForm.htm

I am about to update that article and will be suggesting the use of Document
Variables and DOCVARIABLE fields in place of bookmarks.

To create a document variable and insert the value in the control TextBox1
into it, you use

ActiveDocument.Variables("varname").Value = TextBox1
ActiveDocument.Fields.Update

in place of the code that inserts the values before the .Range of the
bookmarks.

In the template, you would have { DOCVARIABLE "varname" } fields in all of
the places where you want the informaiton that is inserted into TextBox1 to
appear.

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
L

Lorane

Geri - would "ASK" do it for you? It is like FILL-IN, but you can put
it in lots of places by using REF.

Lorane
just a humble newbie
 

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