Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom Tom is offline
external usenet poster
 
Posts: 44
Default PrintOut with Adobe Acrobat 6.0

Hi

Does anybody know how to print out with VBA a worksheet with Adobe Acrobat
6.0?

Tom



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default PrintOut with Adobe Acrobat 6.0

"Tom" wrote in
:

Hi

Does anybody know how to print out with VBA a worksheet with Adobe
Acrobat 6.0?

Tom




Here's a code snippet I've used when printing out worksheets with the
Adobe Distiller. You'll need to reference the "Adobe Distiller" library
and the "Registration Manipulation Classes" library. The key to printing
with the Adobe Distiller is that the device name is not guaranteed to be
the same on any two machines. There's a numerical value in the device
name when installed that can change based on other installed devices, but
the GetDistillerPrinterName gets the correct value.

Sub SomeMethod(ws As Excel.Worksheet, fileDest As String)
Dim aDist As New ACRODISTXLib.PdfDistiller
Dim sPrinter As String

sPrinter = GetDistillerPrinterName 'See function below
If sPrinter = vbNullString Then
MsgBox "Adobe Distiller printer not found!"
Exit Sub
End If

ws.PrintOut 1, , , , sPrinter, True, , fileDest & ".ps"
aDist.FileToPDF fileDest & ".ps", fileDest & ".pdf", ""
Kill fileDest & ".ps"
End Sub

'-----------------------------------------------------------------------

Public Function GetDistillerPrinterName() As String
'Purpose: Examines registry to determine the printer name for installed
' Adobe Distiller.

Dim rKey As RegObj.RegKey
Dim s As String

Set rKey = Registry.RegKeyFromString("\HKEY_CURRENT_USER\Soft ware
\Microsoft\Windows NT\CurrentVersion\Devices\")
s = rKey.Values("Acrobat Distiller").Value
If Len(s) Then
GetDistillerPrinterName = "Acrobat Distiller on " & Replace(s,
"winspool,", "")
End If
End Function


HTH
--
Andrew Mauer

To reply directly, remove .nospam from address.
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
can't print to adobe acrobat georgef Charts and Charting in Excel 2 July 4th 08 04:52 AM
Adobe Acrobat and Exel oloma Excel Discussion (Misc queries) 1 February 28th 06 12:31 AM
Adobe Acrobat DKS1 Excel Discussion (Misc queries) 5 July 13th 05 07:10 PM
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
Automate Adobe Acrobat? pk Excel Programming 1 October 27th 03 07:11 PM


All times are GMT +1. The time now is 10:33 PM.

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"