Davidprince
Programmer
Ladies and Gentlemen,
Hereunder is some code to add a new word doc programmatically. Could someone please advise me how to add a template (in this case a letterhead which is at
C:\Documents and Settings\David\My Documents\Standard Documents\Carlton & Partners letterhead 05) instead of a new document:
Private Sub cmdModifyDocument_Click()
Dim wrdApp As New Word.Application
Dim wrdDoc As Word.Document
wrdApp.Visible = True
Set wrdDoc = wrdApp.Documents.Add
With wrdDoc"
.Range.InsertBefore "Hello there everyone!"
.SaveAs "C:\Greetings.doc"
End With
Set wrdApp = Nothing
End Sub
Thanks
David
Hereunder is some code to add a new word doc programmatically. Could someone please advise me how to add a template (in this case a letterhead which is at
C:\Documents and Settings\David\My Documents\Standard Documents\Carlton & Partners letterhead 05) instead of a new document:
Private Sub cmdModifyDocument_Click()
Dim wrdApp As New Word.Application
Dim wrdDoc As Word.Document
wrdApp.Visible = True
Set wrdDoc = wrdApp.Documents.Add
With wrdDoc"
.Range.InsertBefore "Hello there everyone!"
.SaveAs "C:\Greetings.doc"
End With
Set wrdApp = Nothing
End Sub
Thanks
David