-----Original Message-----
I've created a form to capture responses to be inserted
into a Word document (many thanks to Dian Chapman and her
articles). Now I need to know how to open Word through ADO
and VB.
Any help?
.
Include reference to OLE Automation in your VB
projects 'References'
Set oWord = CreateObject("Word.Application")
'Assuming that you have created word Bookmarks at the
appropirate location within the Word Document (Template)
With oWord
' Make Word visible if you want to do so
.Visible = True
' Open Template file
.documents.Open ("C:\My Documents\Any.dot")
' Output data from VB form
.ActiveDocument.Bookmarks("Bm1").Select
.Selection.TypeText frmText1.Text
.Selection.TypeParagraph
' next output from form
.ActiveDocument.Bookmarks("Bm2").Select
.Selection.TypeText frm.textbox2.text
Wend