General information
Category:
COM/DCOM and OLE Automation
I have an app that prints multiple Word documents in succession. The code goes a little something like this...
range = "999"
from = "1"
to = "999"
oword = CreateObject("Word.Application")
dimension filelist(1)
filecnt = adir(filelist, print_dir + alltrim(print_spec))
dest_file = dest_fn(filelist(n,1))
print_file = print_dir + filelist(n,1)
if filecnt > 0
for n = 1 to filecnt
WITH oword
.Documents.Open(print_file)
.ActiveDocument.PrintOut(0,0,range,"",from,to)
.Quit
ENDWITH
delete file (print_file)
endfor
endif
The problem is that I get an error on the second pass through that says: Member DOCUMENTS does not evaluate to an object. What does this mean? More importantly- How do I fix it.
So I guess I dont REALLY have an app that prints multiple Word docs in succession. I have an app that prints 1 Word doc and then breaks really bad.
Thanks in advance...
Tom Welch
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only