S
Suzette
I checked help on Word and found some code that will print a bunch of files
in a directory but I'm having problems using Automation to do it from
another program.
Here's the help. This code works splendidly in Word:
adoc = Dir("*.DOC")
While adoc <> ""
Application.PrintOut FileName:=adoc
adoc = Dir()
WendHere's my code. This is embedded in another program. I have a
reference set to Word. When it gets to the printout line I get an error.
"This method or property is not available because a document window is not
active."
Dim adoc As String
Dim wdapp As Word.Application
Set wdapp = New Word.Application
adoc = Dir("*.DOC")
While adoc <> ""
wdapp.Application.PrintOut FileName:=adoc
adoc = Dir()
Wend
wdapp.Quit
Set wdapp = Nothing
Any ideas, suggestions?
Thanks
in a directory but I'm having problems using Automation to do it from
another program.
Here's the help. This code works splendidly in Word:
adoc = Dir("*.DOC")
While adoc <> ""
Application.PrintOut FileName:=adoc
adoc = Dir()
WendHere's my code. This is embedded in another program. I have a
reference set to Word. When it gets to the printout line I get an error.
"This method or property is not available because a document window is not
active."
Dim adoc As String
Dim wdapp As Word.Application
Set wdapp = New Word.Application
adoc = Dir("*.DOC")
While adoc <> ""
wdapp.Application.PrintOut FileName:=adoc
adoc = Dir()
Wend
wdapp.Quit
Set wdapp = Nothing
Any ideas, suggestions?
Thanks