Hi Ted
The code I was using was:
Create Excel Instance with oleExcel.CreateObject("Excel.Application")
Add new Work sheet
Set up Worksheet Margins Column Widths etc
Place text and variables into worksheet
Format Cells as required
Save Sheet in C:\POExcel with filename "PurchaseOrderNo + " " +
PurchaseOrderDate" + .xls
Store "PurchaseOrderNo + " " + PurchaseOrderDate" + .pdf to lcFileName
Then create pdf
pdfjob = ""
pdfjob = Createobject("PDFCreator.clsPDFCreator")
With pdfjob
.cOption("UseAutosave") = 1
.cOption("UseAutosaveDirectory") = 1
.cOption("AutosaveDirectory") = "C:\PurchaseOrders\PDFs\"
.cOption("AutosaveFilename") = lcFileName
.cOption("AutosaveFormat") = 0 && save as pdf
.cOption("SaveFilename") = "C:\PurchaseOrders\PDFs\" +
Alltrim(lcFileName)
.cClearCache
oleExcel.ActiveSheet.PrintOut(,,1,.F.,"PDFCreator on
NE00:",,.T.,)
EndWith
oleExcel.Quit
pdfjob = .Null.
So the only things missing seem to be "PDFDissallowPrinting"
And the security settings which as I read the article is only necessary
if you are wanting to set them
And setting pdfjob.cDefaultPrinter to "PDFCreator"
I will try putting all the options in and see if this helps but if I
monitor the registry as I step through the code, my original code
changes everything except the "UseAutoSave" setting
In my last post I said the registry hacks worked if I single stepped so
I tried putting a breakpoint in immediately after the Print to PDF line
and this worked ok and if I clicked continue everything was OK. This
suggest that I need to insert a delay after that line. Anyone got
suggestions on how to achieve that other than
For lnDelay = 1 to 5000
&& Do Nothing
EndFor
Cheers
Peter
Peter Hart Computers
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Ted Roche
Sent: 13 November 2007 13:47
To: [email protected]
Subject: Re: [PDFCreator in VFP Application
On Nov 12, 2007 5:30 PM, Peter Hart <[EMAIL PROTECTED]>
wrote:
> Tried Ricks suggestion but drivers won't install on XP 64bit edition
so couldn't continue with that idea or any of the others suggesting
printing to postscript file first.
>
Peter: A quick Google points to http://www.pdfforge.org/node/404,
"PDF Creator and COM -- Lessons Learned"
I've found the pdfforge to be a handy resource in the past. You might
want to browse around there.
--
Ted Roche
Ted Roche & Associates, LLC
http://www.tedroche.com
[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/[EMAIL PROTECTED]
** 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.