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

Tip: Looking for answers? Try searching our database.

Using forms to populate fields in a document

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kirrlz - 03 Nov 2006 01:16 GMT
Hi,

I'm not sure if this can be done but I have made a form and would like to
use the text entered into the text fields to populate fields throughout the
document.

eg.  A field 'Company Name' on a form, which when the user inputs their
company name - say 'Microsoft' the word 'Microsoft' appears in all fields set
to be a company name field throughout the rest of the document.

Please let me know what the best way to go about this would be, I dont even
know where to start!

Thanks,

Kirrlz
Jay Freedman - 03 Nov 2006 02:42 GMT
See http://gregmaxey.mvps.org/Repeating_Data.htm.

--
Regards,
Jay Freedman
Microsoft Word MVP        FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.

>Hi,
>
[quoted text clipped - 12 lines]
>
>Kirrlz
Doctorjones_md - 03 Nov 2006 16:44 GMT
This seems to work well --

You have your document (in this case -- TirePressureCheck.doc)

1.  You open VBE and add a UserForm1

2  Add a ListBox1 and CommandButton1 to your form

The code for these objects are as follows:

Private Sub CommandButton1_Click()

With ActiveDocument
   .Bookmarks("Report_Number").Range _
   .InsertBefore TextBox1
   .Bookmarks("Date").Range _
   .InsertBefore TextBox2
   .Bookmarks("Location").Range _
   .InsertBefore TextBox3
   .Bookmarks("Spool_Details").Range _
   .InsertBefore TextBox4
   .Bookmarks("Pump_Pressure").Range _
   .InsertBefore TextBox5
   .Bookmarks("Name1").Range _
   .InsertBefore ComboBox1.Text
   .Bookmarks("Name2").Range _
   .InsertBefore ComboBox1.Text
   .Bookmarks("Name3").Range _
   .InsertBefore ComboBox1.Text
End With

UserForm1.Hide
End Sub

Private Sub UserForm_Initialize()
   With ComboBox1
       .AddItem "George Foreman"
       .AddItem "Archie Bunker"
       .AddItem "Alan Greenspan"

   End With

End Sub

HTH

> Hi,
>
[quoted text clipped - 15 lines]
>
> Kirrlz
 
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.