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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report to MsWord

Status
Not open for further replies.

Stephenlyn

Programmer
May 25, 2000
34
AU
Hi

I have 4 MS Word documents that I want to send data to from a MS Access Form. Which MS Word document to use is determined by a radio button group on the MS Access Form.

I'm having a bit of problem understanding what dim statements I need and what they do, particularly the path.

Any help would be appreciated.

cheers

Steve

 
Boy! What your asking to do is a lot the first time around but I'll try to put it in to a nut shell and point you in the right direction (I hope).

The method I prefer at this time is to use the DocVariables option. On the Word document from the menu use the Insert.. Field..Document Automation..DocVariables Option. What you are going to do is place the docvariable at the location within the Word doc that you want the infomation to appear. Make sure you name the Variable as you place it the name should appear right after the word "DOCVARIABLE" and should be enclosed in quotes.

Step two after opening the desired word document from your list populate the activedocument.variables("NAME") with the value desired activedocument.variables("NAME").value = "ABC" or 123. The secret is after all the variables have been populated with the values desired you must update the field in order to view them. the following code should do the trick:

currDoc.Select
currDoc.Content.Select
currDoc.Sections(1).Range.Fields.Update

Where currdoc is the document you want to update

One last point to keep in mind when using this method the values are sored in the document and unless over written the next time they will present them selves again. Therefor enter a value for every variable every time you call the rotine even if the value is "".

Good Luck
ssecca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top