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!

FormFields in word

Status
Not open for further replies.

wanmaster

Programmer
Nov 20, 2000
94
NL
I'd like to generate a letter (word document), by using formfields and replacing their values with data found in an access table. This works fine. The only thing left: I would like to generate multiple letters (based on the same template) into a single word document. So that if I open the document, I can print all the letters.

This is (a part of) the code I'm using:
Code:
Set loWordApp = CreateObject("Word.Application")
loWordApp.Documents.Add "C:\template.dot"
(...)
With loWordApp.ActiveDocument
	While Not loRS.EOF
            For i = 0 To loRS.Fields.Count - 1
                On Error Resume Next
                .FormFields(loRS.Fields(i).Name).Result = "" & loRS.Fields(i)
                On Error GoTo 0
            Next
            loRS.MoveNext
        Wend
End With

Remedy
 
Never mind, already found a solution..

Remedy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top