Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / August 2006

Tip: Looking for answers? Try searching our database.

How to set up macro that copies text to another place in same docu

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nevets - 04 Aug 2006 18:32 GMT
I'm trying to set up a form in Word 2002.  I want to set up the form such
that when a user enters a number in one place in the document, the same
number is automatically entered in a second location.  I've tried running a
macro on exit from the first text form field that copies then pastes the
number to the other form field below, but I get an error message (Microsoft
Visual Basic. Run-time error 4605: This method or property is not available
because the obfect refers to a protected area of the document).  I tried it
again, by taking out the second form field, and just trying to paste the
number to a specific spot, but I get the same error message.
What am I doing wrong??
Greg Maxey - 04 Aug 2006 19:15 GMT
You don't need a macro.  Let's say your source field is "Text1."
Unprotect the document and double click the source field.  Verify the
name "Text1" and check "Calculate on exit."  Close the dialog box.  Go
where you want this source field repeated.  Press CTRL+F9  in the {  }
that appear, type Text1.  Right click the field and select toggle field
code.  Protect the document and you are done.

> I'm trying to set up a form in Word 2002.  I want to set up the form such
> that when a user enters a number in one place in the document, the same
[quoted text clipped - 6 lines]
> number to a specific spot, but I get the same error message.
> What am I doing wrong??
Nevets - 08 Aug 2006 00:50 GMT
Thanks for the help, Greg.....so far!!
Two questions:
It's working so far, but a minor problem that I'd like to solve is that I'd
like the text size in the second place (the field result??) to be smaller
that the source field.  Is there any way to do that?
Second, since I like to understand what I'm doing, what does the last step
do?  What am I doing when I "Toggle Field Code".

Again, Thanks.

> You don't need a macro.  Let's say your source field is "Text1."
> Unprotect the document and double click the source field.  Verify the
[quoted text clipped - 13 lines]
> > number to a specific spot, but I get the same error message.
> > What am I doing wrong??
Greg Maxey - 08 Aug 2006 01:11 GMT
Enter the field braces as before {   }  inside the braces, type "Text1 \*
Charformat" (without the quotations). Select the "T" is "Text1" and format
it the size you want the result to display.  Right click the field and
select toggle field code.  Protect the document and you are done.

Toggle field code means to toggle the display on the screen between the
field code and the result of the field.

So if I had a form field text box bookmarked myName and wanted my name
repeated in a document, I would enter field codes like { myName } here and
{ myName } there.  When I toggled the field code to display the results I
would see Greg here and Greg there.  Or if we used your name we would see
Nevets here and Nevets there.

Good luck.

Signature

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

> Thanks for the help, Greg.....so far!!
> Two questions:
[quoted text clipped - 25 lines]
>>> error message.
>>> What am I doing wrong??
Nevets - 08 Aug 2006 13:23 GMT
Thanks, Greg; your my hero.

> Enter the field braces as before {   }  inside the braces, type "Text1 \*
> Charformat" (without the quotations). Select the "T" is "Text1" and format
[quoted text clipped - 41 lines]
> >>> error message.
> >>> What am I doing wrong??
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.