Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Automating Acrobat from Excel

I am trying to set up a macro that selects certain
worksheets in a workbook, prints them to a pdf file, and
then attaches that file to an email. I have most of it
cracked, but can't seem to fathom out how to convert the
postscript file I have created into a pdf file. I am using
Excel 2000 and Adobe acrobat v.5 (full version)

The code I have so far is as follows:

'Select the sheets to send to send to adobe post script'

Sheets(Array("Sheet1", "Sheet2", "Sheet3")).Select
Sheets("Workbook1").Activate
Application.ActivePrinter = "Acrobat Distiller on
Ne00:"
ActiveWindow.SelectedSheets.PrintOut copies:=1,
ActivePrinter:= _
"Acrobat Distiller on Ne00:", printtofile:=True,
Collate:=True, PrToFileName:="FilePath\Filename.ps"
Sheets("PRINT LIST").Select

'This is where I need to convert the above to a pdf and
kill the ps file. '

Dim objOutlook As Outlook.Application
Dim objEmail As Outlook.MailItem
Set objOutlook = CreateObject("Outlook.Application")
Set objEmail = objOutlook.CreateItem(olMailItem)
With objEmail

'.To = emailadresses
'.CC = more emailadresses
'.Subject = "subject"
'.Body = ""
Set objOutlook = CreateObject
("Outlook.Application")
Set objEmail = objOutlook.CreateItem(olMailItem)
.To = "
.Subject = "Monthly Bed occupancy statistics"
.Body = "Dear recipient " & vbCrLf & " Blah Blah
Blah" & vbCrLf & vbCrLf & "Kind Regards"
.Attachments.Add "FilePath\FileName.pdf"
.display
End With


End Sub

I would hugely grateful to anybody who could help me
resolve this problem

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default Automating Acrobat from Excel

Something along these lines may work

Dim myPDF As PdfDistiller
Set myPDF = New PdfDistiller
myPDF.FileToPDF PSFileName, PDFFileName, ""
kill(PSFileName)

Dan E

"Paul Falla" wrote in message
...
I am trying to set up a macro that selects certain
worksheets in a workbook, prints them to a pdf file, and
then attaches that file to an email. I have most of it
cracked, but can't seem to fathom out how to convert the
postscript file I have created into a pdf file. I am using
Excel 2000 and Adobe acrobat v.5 (full version)

The code I have so far is as follows:

'Select the sheets to send to send to adobe post script'

Sheets(Array("Sheet1", "Sheet2", "Sheet3")).Select
Sheets("Workbook1").Activate
Application.ActivePrinter = "Acrobat Distiller on
Ne00:"
ActiveWindow.SelectedSheets.PrintOut copies:=1,
ActivePrinter:= _
"Acrobat Distiller on Ne00:", printtofile:=True,
Collate:=True, PrToFileName:="FilePath\Filename.ps"
Sheets("PRINT LIST").Select

'This is where I need to convert the above to a pdf and
kill the ps file. '

Dim objOutlook As Outlook.Application
Dim objEmail As Outlook.MailItem
Set objOutlook = CreateObject("Outlook.Application")
Set objEmail = objOutlook.CreateItem(olMailItem)
With objEmail

'.To = emailadresses
'.CC = more emailadresses
'.Subject = "subject"
'.Body = ""
Set objOutlook = CreateObject
("Outlook.Application")
Set objEmail = objOutlook.CreateItem(olMailItem)
.To = "
.Subject = "Monthly Bed occupancy statistics"
.Body = "Dear recipient " & vbCrLf & " Blah Blah
Blah" & vbCrLf & vbCrLf & "Kind Regards"
.Attachments.Add "FilePath\FileName.pdf"
.display
End With


End Sub

I would hugely grateful to anybody who could help me
resolve this problem



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do i add the Acrobat menu in excel 2007? Bob Excel Discussion (Misc queries) 1 May 20th 09 10:04 PM
Excel 07/Acrobat 8.1.4 Misty Excel Worksheet Functions 4 April 9th 09 01:25 PM
excel and acrobat adobieversexcel Excel Discussion (Misc queries) 1 March 13th 07 10:05 AM
Excel to acrobat mlcavanzo Excel Worksheet Functions 2 April 28th 05 01:44 AM
how to re install Adobe Acrobat in Excel? The adobe Acrobat work. Execl error Excel Discussion (Misc queries) 1 March 17th 05 02:29 AM


All times are GMT +1. The time now is 11:25 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"