Frank:
I never thought of shellexecute! I will try it.
Here is the code:
oWord = createobject("Word.Application") &&in error trap there a return if Word
is not on the box
if type("oWord") <> "O" then
wait window "Word Not Found On This Computer..." timeout 2
wait window "Returning..." timeout 2
thisform.cmdPrint.enabled = .f.
return
endif
oWord.Visible = .f. &&hide the word app...
for i = 1 to alen(laQueue,1)
thisform.lstAttachments.listindex = laQueue(i,2)
wait window "Queuing " + laQueue(i,1) + "..." nowait
thisform.txtDocument.value = laQueue(i,1)
thisform.txtDocument.refresh()
oWord.Visible = .f. &&hide the word app...
oWord.Documents.Open(laQueue(i,1))
oWord.Application.PrintOut()
wait window "" timeout 5 &&long enough? How can I be sure it was sent to the
printer???
oWord.Documents.Close()
gaWord_docs(laQueue(i,2),1) = "PRT~~~" + justfname(laQueue(i,1))
thisform.lstAttachments.refresh()
lnPrinted = lnPrinted + 1
thisform.txtDocs_printed.value = lnPrinted
thisform.txtDocs_printed.refresh()
endfor
Thanks for taking a look.
Jack
________________________________________
From: ProfoxTech [[email protected]] on behalf of Frank Cazabon
[[email protected]]
Sent: Wednesday, May 08, 2013 10:45 AM
To: [email protected]
Subject: Re: Print A Word Document From VFP
ShellExecute can be used to print a file
Frank.
Frank Cazabon
On 08/05/2013 10:29 AM, Kurt Wendt wrote:
> Just a total WAG here - but, was just wondering if there is Another way to
> get it printed Without doing Word Automation. Within Windoz Explorer you can
> right-click on a Doc & just say print - without having to actually open
> Word. Right? So - was curious if there is some way to send the Doc to the
> printer - doing something similar. Maybe even a DOS command - using the VFP
> RUN command - to send the Doc to printer via COPY to a printer.
>
> Again - just a WAG & me thinking out loud. Of course, if you are running Ur
> App in a newer version of Windoze - like Win7 - then this approach probably
> will NOT Work...
>
> -K-
>
> -----Original Message-----
> From: ProfoxTech [mailto:[email protected]] On Behalf Of Jack
> Skelley
> Sent: Tuesday, May 07, 2013 7:28 PM
> To: [email protected]
> Subject: Print A Word Document From VFP
>
> Good Evening All:
> I am creating a Word 2010 automation form to open a document and print it.
> I have a few questions:
> 1 - Except for the first file opened every file there after will flash the
> Word interface even though I issue a .visible = .f. and issue a Word
> minimized command
> How DO I stop the screen flash from Word when the second and subsequent
> documents are opened?
> 2- How do I know the document has been queued before I move to the next one?
> Except for the annoying screen flash the code works ok if I pause between
> docs to allow it to queue.
> No editing involved here. Simple open a file and send it to a printer...
> Thanks for any help.
> Best regards,
>
> Jack Skelley
>
> Jack Skelley
> Senior Director, Programming/Computer Operations
> New Jersey Devils
> (973)757-6164
> [email protected]
>
[excessive quoting removed by server]
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/7d9e7f72b813014c8fd022cf04f820ed58633...@ex08.drdad.thenewarkarena.com
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.