Hi Michael

Sent direct to mbabcockatmbsoftwaresolutionsdotcom

As you will see from the code I pick up the PDF Creator Printer and
using windows scripting change the default printer to that.
On finishing I change the default printer back to what it was.  The
problem is that if I save what Excel says is the default printer and
then try and set back to it, the variable used holds something like
"OK5600c on NE001:"
I then used APRINTERS() to see what windows says it is and had the same
problem i.e. Windows Scripting says it cant set the printer as no such
printer exists.  I have to Look fro NE plus numbers and use a STRTRAN to
get rid it then works, in the code you will see I look for the whole
Printer name and change it.  But I can't do this at the clients site.
The first I knew there was a problem was when there IT chap said they
were all complaining that there printers wouldn't work and he was having
to change them back to default in start/settings/printers.
Cheers

Peter
Peter Hart Computers


-----Original Message-----
From: [email protected] [mailto:[email protected]] On
Behalf Of MB Software Solutions,LLC
Sent: 04 September 2009 15:46
To: ProFox Email List
Subject: Re: Need ideas for Excel to PDF automation

Peter Hart wrote:
> Hi Michael
> Do you want me to send you the bit of code I use to create my purchase
> order and then print to pdf.  This use the PDF Creator printer driver.
> In your case the Excel Files are already created so you just need
ADIR()
> or something similar to pick up the files to print and then loop
through
> sending them to PDF Creator.  The only problem I have is that Excel
> picks up the default printer as XXXX on Ne0X: and sometimes this is
not
> recognised when the program tries to restore it.  You could probably
> ignore that bit of code and just reset the printer manually.
> It should not be too hard to create a macro in excel and let the user
> just click a button. Just reverse the code to the VBA equivalents. In
> fact the reverse of what I do to get my VFP code,  Open Excel, record
a
> macro to do what I want VFP to do.  Copy and paste the code into VFP
and
> then change it were VFP's Syntax is slightly different.
> 
> Cheers
> 
> Peter
> Peter Hart Computers


Absolutely, please send me the code.  THANKS!

As for the problem you cite above, are you saying that if you set the 
default printer before you run that process to be PDFCreator, it then 
works ok?


-- 
Mike Babcock, MCP
MB Software Solutions, LLC
President, Chief Software Architect
http://mbsoftwaresolutions.com
http://fabmate.com
http://twitter.com/mbabcock16


[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/a57fa4cf19531343a2ee11b57db8e3af04c...@server.peterhartcomputers.local
** 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.

Reply via email to