Thread
:
create pdf file from vba
View Single Post
#
3
May 11th 06, 06:38 PM posted to microsoft.public.outlook.program_vba
Nader
external usenet poster
Posts: 29
create pdf file from vba
sorry I wasn't thinking.
Is there a way to create a pdf using vba from an outlook message ?
thanks.
"Ken Slovak - [MVP - Outlook]" a écrit dans le message
de news:
...
And your Outlook programming question is... ?
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm
"Nader" wrote in message
...
Hello,
I've code right here that create a pdf from any document and merge it to
another existing pdf. My only problem is that when I use the function
avFormCapture.Open "", "" to create the pdf, the files is
opened.
Is there way so nothing open or instead just some kind of progress bar ?
Thanks
The code I use :
Option Compare Database
Option Explicit
Sub Attach2Pdf()
Dim objCurrent As AccessObject
Dim Acroapp As CAcroApp
Dim avCodeFile As CAcroAVDoc
Dim avFormCapture As CAcroAVDoc
Dim pdCodeFile As CAcroPDDoc
Dim pdFormCapture As CAcroPDDoc
Dim lngPage As Long
'Start Acrobat in the background
Set Acroapp = CreateObject("AcroExch.App")
'Uncomment the following line if you want to watch the program run
'Acroapp.Show
Set avCodeFile = CreateObject("AcroExch.AVDoc") 'This is the code file
Set avFormCapture = CreateObject("AcroExch.AVDoc") 'This will be each
jpg in turn
'Open the fax
avCodeFile.Open "C:\Documentation\CodeFile.pdf", "Fax Sent"
Set pdCodeFile = avCodeFile.GetPDDoc
'Open the receipt in order to be merged with the fax
avFormCapture.Open "C:\Documentation\email.doc", "Fax Receipt"
Set pdFormCapture = avFormCapture.GetPDDoc
lngPage = pdCodeFile.GetNumPages - 1
'Insert the file at the right page
pdCodeFile.InsertPages lngPage, pdFormCapture, 0, 1, 0
pdFormCapture.Close
avFormCapture.Close 1
Set pdFormCapture = Nothing
'close the doc file now with form captures
pdCodeFile.Close
avCodeFile.Close 0
'Exit Acrobat
Acroapp.Exit
Set objCurrent = Nothing
Set Acroapp = Nothing
Set avCodeFile = Nothing
Set pdCodeFile = Nothing
Set avFormCapture = Nothing
End Sub
Nader
View Public Profile
View message headers
Find all posts by Nader
Find all threads started by Nader
Ads