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 / March 2007

Tip: Looking for answers? Try searching our database.

Steps to write and activate macro in Word 2003

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
TNSanofi - 13 Mar 2007 18:54 GMT
Folks,

Any step by step for adding a macro into a word 2003 document?

I want to read one Bookmark A and based on this value show in another field
a default value for Bookmark B or text field. Example: The dropdown value
selected  is equal to text "NYC", the default value sould be text "SOHO". How
do I get SoHo to show  up in Bookmark B or text field? Then if the dropdown
value is changed to "Boise" the default value in the other field would be
default to "Idaho".

thx.
Greg Maxey - 13 Mar 2007 20:03 GMT
Assuming your have a dropdown field  ("Dropdown1") and a text field
("Text1"), copy the following code to a project module in the
document:

Sub OnExitDD1()
Dim oFFs As FormFields
Set oFFs = ActiveDocument.FormFields
Select Case oFFs("Dropdown1").Result
 Case "NYC"
   oFFs("Text1").Result = "SOHO"
 Case "Boise"
   oFFs("Text1").Result = "Idaho"
 Case Else
   'Do Nothing
End Select
End Sub

Unprotect the form, double click the dropdown field and set
"OnExitDD1" to run on exit.  Double click the text field and uncheck
"Enabled"

Reprotect and your done.

On Mar 13, 1:54 pm, TNSanofi <TNSan...@discussions.microsoft.com>
wrote:
> Folks,
>
[quoted text clipped - 8 lines]
>
> thx.
 
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.