Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Html - pdf
Message
 
To
12/05/2014 11:36:15
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 8
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01599358
Message ID:
01599865
Views:
43
I agree. But Peter said he was using MSWord to create "the file", and he was talking about an html file. I did not see him complaining about what MSWord was creating for him, and dumping it to PDF, then it should be fine.

I use a web brower control/editor to compose message templates, not necessarily html "reports".

Curious, are you creating html "reports" and what are you using?


>Have you ever look at the HTML that Word creates? Using Word to create HTML is not a good idea.
>
>>If you are creating the html file in MSWord, i would think that you could use MSWord's "save as PDF" feature (which i believe was added in Word2010, there are downloads for earlier versions).
>>
>>
>>#define wdDoNotSaveChanges  0
>>#define wdExportFormatPDF 17
>>#Define wdAlertsNone    0
>>
>>llAttachPDF = .t.
>>TRY
>>	WordObj = CREATEOBJECT("Word.Application")
>>	WordObj.Application.DisplayAlerts = wdAlertsNone
>>	WordObj.documents.open("&lcPassedInDoc")
>>	WordObj.visible = .f.
>>	
>>	*--- lOpenPDF: is set to true or false.  Controls whether PDF is displayed.
>>	*---
>>	WordObj.ActiveDocument.ExportAsFixedFormat("&lcPDFname", 17, lOpenPDF)
>>
>>
>>
>>>i vae a prg which creates an html document which I need as a pdf so I can email it to someone with all the photos in place
>>>I use cutepdf but that propmts for a file name
>>>
>>>is there a programatic way to do this? this is what I do at the bottom of the prg and it requires manual printing, adding afilename and then opening the pdf and emailing...
>>>I would like to do this fully automated
>>>possible??? How???
>>>
>>>
>>>
>>>lcWordFname = FULLPATH([TownDossier_]+lcTownName+[_]+CHRTRAN(TRANSFORM(DATETIME()),[\/: ],[])+[.htm]) 
>>>STRTOFILE(lcHTML , lcWordFname )
>>>
>>>
>>>Local oWord as word.application
>>>oWord=Createobject("word.application")	&& Create word object
>>>oWOrd.Visible = .t.
>>>With oWord
>>>  .documents.open(lcWordFname)  && New file or open a template
>>>	
>>>ENDWITH 
>>>oWord.ActiveDocument.SaveAs(lcWordFname)
>>>oWord.Activate()
>>>
>>>
>>>
>>>thanks
>>>
>>>
>>>Peter
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform