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.

VBA Reading a Word Document's Form Field into a User Form Text Box

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Brendan - 08 Aug 2006 22:28 GMT
How do I grab the value from an Form Field in an active document and then
place that value into a User Form that has a corresponding text box.  I
thought it would be something like this but I can’t seem to get it to work.

Private Sub UserForm1_Initialize()

Me.tbLastFirstMiddle.Value = ActiveDocument.FormFields("docLastFirstMiddle")

End Sub
Brendan - 09 Aug 2006 00:38 GMT
Found my own solution: Had to actually call the form [UserForm1] and forgot
the [Result] tag.  Works fine.

UserForm1.tbLastFirstMiddle =
ActiveDocument.FormFields("docLastFirstMiddle").Result

> How do I grab the value from an Form Field in an active document and then
> place that value into a User Form that has a corresponding text box.  I
[quoted text clipped - 5 lines]
>
> End Sub
Jean-Guy Marcil - 09 Aug 2006 05:44 GMT
Brendan was telling us:
Brendan nous racontait que :

> Found my own solution: Had to actually call the form [UserForm1] and
> forgot the [Result] tag.  Works fine.

Actually, you could have use the Me keyword inside the Userform Initialize
event.
You were right about the Result property though.

Signature

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org

 
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.