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 / January 2006

Tip: Looking for answers? Try searching our database.

Problem with Visual Basic code working in a Word Document.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
robbyp - 24 Jan 2006 19:51 GMT
I have a standard Word document where I have created two text fields from the
control toolbox. I have simple VB code for change as follows:

Textbox1.text = Textbox2.text

When Textbox2 changes, so does the text in Textbox1. It works fine. However,
when I close Word and then re-open, it never works. What gives? Thanks for
your help.
Cindy M  -WordMVP- - 25 Jan 2006 15:37 GMT
Hi =?Utf-8?B?cm9iYnlw?=,

> I have a standard Word document where I have created two text fields from the
> control toolbox. I have simple VB code for change as follows:
[quoted text clipped - 3 lines]
> When Textbox2 changes, so does the text in Textbox1. It works fine. However,
> when I close Word and then re-open, it never works. What gives?

I suspect it may be a question of exactly where the code is stored. There's an
article on msdn.microsoft.com (search my name and ActiveX and you should turn it
up) that describes some of the "ins and outs" of where the code is stored and
how it acts that might shed some light on the problem for you.

Is this really a document, or is it a template from which you're creating a new
document (and that's when it stops)?

Is the code in the ThisDocument module, or another one?

Is this exactly the line of code? You haven't qualified the controls with
ThisDocument or ActiveDocument?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)
 
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.