R
red6000
Hi,
I have code which prints a file using:
Application.PrintOut FileName:="C:\test.doc"
The code works fine, but only if a document is open at the time (it can be
any document).
I've amended the code to be:
Documents.Open Filename:= "C:\tempfile.doc"
Application.PrintOut FileName:="C:\test.doc"
Documents("tempfile.doc").Close wdSaveChanges = False
The actual file to be printed is a variable based on data entered into a
userform. Why does word need any random document open in order for the code
to work and is there a neater way to 'trick' it?
Thanks.
I have code which prints a file using:
Application.PrintOut FileName:="C:\test.doc"
The code works fine, but only if a document is open at the time (it can be
any document).
I've amended the code to be:
Documents.Open Filename:= "C:\tempfile.doc"
Application.PrintOut FileName:="C:\test.doc"
Documents("tempfile.doc").Close wdSaveChanges = False
The actual file to be printed is a variable based on data entered into a
userform. Why does word need any random document open in order for the code
to work and is there a neater way to 'trick' it?
Thanks.