Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Printing Word
Message
From
29/03/2000 09:41:00
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Printing Word
Miscellaneous
Thread ID:
00352065
Message ID:
00352065
Views:
44
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
Map
View

Click here to load this message in the networking platform