Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I use the following code to open a

Status
Not open for further replies.

CleoMan

Programmer
Jun 18, 2003
110
ZA
I use the following code to open a word document i created. This word document is a mail merge document, that is linked to one of my SQL answer tables. If I open and print the document only once, it works great.

liloop = 0
liloop.view( "How many stickers do you want?")
;//get the dynamic alias path for app

spath = getAliasPath(":reportsDB:") + "\\"
doc = "test.doc"

while liloop >0
ShellExecuteA(0,"print",sDoc,"",spath,0)
liloop = liloop - 1
endwhile

But now the user wants to print 3 of these documents , now becuase of the data link the word documents fails to print, becuase the other documents are also trying to acces the table and locking it.

Any ideas?

Thanks
Richard

 
Richard,

Hm. Make multiple calls to shellExecute doesn't really seem the most efficient way to print multiple copies, for Word loads and exits for each copy of the document.

Perhaps the easiest solution is to open the document with shellExecute and then urge the user to use the Number of Copies field in Word's Print dialog.

This could be automated using DDE or OLE Automation. I'll see if I can hack out a good example and post it later this evening. (Might not be until later in the weekend, though, I need to finish running cable into my stepson's room this evening, so he won't be competing with the girls for the downstairs TV (they like to play XBox games, so you can imagine the contention).

In any event, I'll see what I can work up and will post later.

Hope this helps...

-- Lance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top