Hi Guy's
In I have a table/form which I need to export on to a Word Doc. so far I have this code which works fine but I need to export 'ContactName', 'ContactTitle' 'Address','postcode' and so on.
I've tried this bit of code.
In I have a table/form which I need to export on to a Word Doc. so far I have this code which works fine but I need to export 'ContactName', 'ContactTitle' 'Address','postcode' and so on.
Dim objWord As Word.Application
Dim doc As Word.Document
Dim WordHeaderFooter As HeaderFooter
Dim rs As Recordset
Dim ContactName As String
Dim path As String
Set objWord = CreateObject("Word.Application")
With objWord
.Visible = True
Set doc = .Documents.Add
doc.SaveAs CurrentProject.path & "\TestDoc.doc"
End With
With objWord.Selection
.Font.Name = "Arial MS"
.Font.Size = 10
.TypeText "Dear Customer,"
.TypeParagraph
End With
doc.Save
doc.Activate
I've tried this bit of code.
.forms ("fldContactName").Result = Me.ContactName