What have you tried so far? Which methods have you selected, and what problems do you have using them? What code are you using?
I've got nothing. This is my current function
Function createFile(TheLog, FileName)
Const TemporaryFolder = 2
Set objFSO = CreateObject("Scripting.FileSystemObject")
strLogDirectory = objFSO.GetSpecialFolder(TemporaryFolder)
strLogFile = FileName & ".txt"
Set objLogFile = objFSO.CreateTextFile(strLogDirectory & "\" & strLogFile)
Set objFSO = Nothing
Set objLogFile = Nothing
createFile = strLogDirectory & "\" & strLogFile
I was honestly hoping to replace my create object with PDF object and just write to the pdf but i'm getting the inpression it's not going to be so simple.
I was able to find a code that will open nearly any file and save as PDF but I read it wasn't intended to be able to do this. It works the majority of the time but I need code that will work ALL of the time. Some code example on how to write to start a new pdf, write to it and save it would be awesome. Some example on how to append that file to another file would be amazing. Thanks in advance for any help you can provide.
Creating a PDF is a whole different world. A text file just has a bunch of text so you go open-write-close. But a PDF is a collection of pages, graphical content, text, fonts, interactivity and more. At its simplest you "print to PDF" - so if you can print the contents you want already and your end user has installed Acrobat Pro you would
1. Select the Adobe PDF printer
2. Use a special method to specify output file name, partially described in Acrobat SDK.
3. Print the pages you want to make.
4. If needed, reselect previous print.
APIs exist that let you build up PDFs with a series of graphics calls, but this is very difficult to use from an app external to Acrobat.
The series of graphic calls was what I was looking for. I feel like this would be a quicker output then the option I ended up going with.
Save file as txt, open file with word, use word to convert to PDF.