Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto fill contracts

Status
Not open for further replies.

rry2k

Programmer
Joined
Jun 28, 2001
Messages
678
Location
US
Hi,
I have several contracts that were written in Word.
Is there a way to open a Word document from VB then autofill the fields maybe based on a form that is filled out in VB. The contracts/start forms are for employment with alot of redundant info.
 
Yes, you can make links in Word to variables, it would look like

Hello <<name>>,

You have <<orders>> orders in waiting...

To get these links though you have to add them in through word to create your document template. Then through VB you open the doc and send the values. I wish I knew more to tell you, but you may want to search under VBA. Craig, mailto:sander@cogeco.ca

&quot;Procrastination is the art of keeping up with yesterday.&quot;

I hope my post was helpful!!!
 
I would create the contract document with a table, set it up using bookmarks as the field indetifiers. Then use VB to reference each field by the bookmark name.
Use an array with a For..Next loop to store your VB form info. Then open your Word template with the bookmarks.

Word.Application.ActiveDocument.Bookmarks(index).Select
Selection.TypeText(string text)

Without getting my hands dirty, this is the simplest way off the top of my head to get somewhere.
 
Thanks but you went way past me. I need a start on code but we're all very busy so if you don't have time I understand.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top