Hello all
I have a word document opened from access and i would like to add some text as soon as the Word document is opened so when i print the doc. it will print in the header the instruction ID.
Here is the code. (Thank you very much for any help"
Private Sub cmdowd_Click() 'Open Word Document
Dim objWord As Object
Dim ffile As String
Set objWord = CreateObject("Word.Application")
objWord.Visible = True
ffile = Application.CurrentProject.Path & "\" & Me.InstructionID & ".doc"
If Dir(ffile) <> "" Then
objWord.Documents.Open ffile
Else
objWord.Documents.Add
objWord.ActiveDocument.SaveAs ffile
' objWord.ActiveDocument.TypeText Text:="ID=7262362"
End If
Set objWord = Nothing
The instruction objWord.ActiveDocument.TypeText Text:="ID=7262362" does not work
I have a word document opened from access and i would like to add some text as soon as the Word document is opened so when i print the doc. it will print in the header the instruction ID.
Here is the code. (Thank you very much for any help"
Private Sub cmdowd_Click() 'Open Word Document
Dim objWord As Object
Dim ffile As String
Set objWord = CreateObject("Word.Application")
objWord.Visible = True
ffile = Application.CurrentProject.Path & "\" & Me.InstructionID & ".doc"
If Dir(ffile) <> "" Then
objWord.Documents.Open ffile
Else
objWord.Documents.Add
objWord.ActiveDocument.SaveAs ffile
' objWord.ActiveDocument.TypeText Text:="ID=7262362"
End If
Set objWord = Nothing
The instruction objWord.ActiveDocument.TypeText Text:="ID=7262362" does not work