A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

create pdf file from vba



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 11th 06, 10:31 AM posted to microsoft.public.outlook.program_vba
Nader
external usenet poster
 
Posts: 29
Default create pdf file from vba

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


  #2  
Old May 11th 06, 04:03 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default create pdf file from vba

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



  #3  
Old May 11th 06, 06:38 PM posted to microsoft.public.outlook.program_vba
Nader
external usenet poster
 
Posts: 29
Default 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





  #4  
Old May 12th 06, 03:26 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default create pdf file from vba

Not unless you have some addin or other code that would create a PDF file,
Outlook has no native support for PDF and neither does VBA.

--
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
...
sorry I wasn't thinking.
Is there a way to create a pdf using vba from an outlook message ?
thanks.


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
vba code that insert a hyperlink file in the body of message gabriel Outlook and VBA 3 April 24th 06 02:51 PM
Is it possible to create and publish Outlook Custom Form through VBA [email protected] Outlook - General Queries 3 March 10th 06 10:25 PM
Is it possible to create and publish Outlook Custom Form through VBA [email protected] Outlook - General Queries 1 March 10th 06 03:51 PM
create meeting request from another mailbox in VBA? Nick B Outlook and VBA 1 March 7th 06 08:09 PM
Compress PST-File with VBA Heinz-Dieter Janzen Outlook and VBA 1 February 28th 06 05:55 PM


All times are GMT +1. The time now is 08:25 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.