I am trying to write a script with PDF Creator to send a report to PDFCreator, have it convert it and then email it. I am using Visual FoxPro 9 (VFP) but it is very simple code. Here it is:
*-- This is a test
PUBLIC goQ as PDFCreator.JobQueue
LOCAL loJ as PDFCreator.PrintJob, lcFileName
*-- Instantiate and initalize PDFCreator
goQ = CREATEOBJECT("PDFCreator.JobQueue")
goQ.Initialize()
*-- Create a random filename in the current directory
*-- I will use that in the Job settings
lcFileName = CURDIR()+SYS(2015)+".pdf"
*-- send the report to PDFCreator
SET PRINTER TO PDFCreator
REPORT FORM zipcodes ENVIRONMENT TO PRINTER NOCONSOLE
*-- PDFCreator pops up a SaveAs dialog here. I hit enter as fast as I can
IF !goQ.WaitForJob(20)
MESSAGEBOX("Error getting print job.",16)
ELSE
loJ = goQ.NextJob()
loJ.SetProfileByGuidOrName("VisionPoint")
loJ.SetProfileSetting("EmailClientSettings.Recipients", "njChazzan@gmail.com")
loJ.SetProfileSetting("EmailClientSettings.RecipientsBcc", "bazianm@gmail.com")
loJ.SetProfileSetting("EmailClientSettings.Subject", "Your invoice from Emerson Recycling")
loJ.ConvertTo(lcFileName)
ENDIF
goQ.ReleaseCom()
Like I said, I think the quote is pretty straightforward. What is happening is this: When I send the report to the printer, it pops up a saveas screen. I hit SAVE, it completes the conversion, and opens PDF Architect. The job is never found in the queue.
I am using PDFCreator Professional. I have the default profile set to save automatically and I added an SMTP account to the default profile. I am NOT loading a profile so it should use the default, right?
THanks up front for your help.
2 posts - 2 participants