Hi all
I have some VBA code that opens up a word document, copies data from the access form into the word document then automatically prints.
the word document is an envelope template.
for some reason the printer doesn't automatically recognize the paper type is an envelope, is there a way to force the printer to think this within the VBA code?
I have some VBA code that opens up a word document, copies data from the access form into the word document then automatically prints.
the word document is an envelope template.
for some reason the printer doesn't automatically recognize the paper type is an envelope, is there a way to force the printer to think this within the VBA code?
Code:
Public Function FUNC_CreateC5Envelope()
'FIND WORD FILE
Dim oWd As Object 'Word.Application
Dim oDoc As Object 'Word.Document
Dim bm As Object 'Word.Bookmark
'Set oWd = New Word.Application
Set oWd = CreateObject("Word.Application")
Set oDoc = oWd.Documents.Add(CurrentProject.Path & "\TemplateFiles\C5EnvelopeTemplate.docx")
***********FIELD INPUTS HERE ******
'PRINT OUT
oDoc.PrintOut
'Close but dont save
oDoc.Close False
oWd.Quit
Set oDoc = Nothing
Set oWd = Nothing
'oWd.Visible = True
End Function