Solved

VBA and Print as PDF Options

Posted on 2004-09-21
6
798 Views
Last Modified: 2007-12-19
we have WIN2K; Adobe Reader/Write Software (adobe pfd writer, adobe pdf destiller) on our computers. I Want to set the PDF Printer Options via some lines of Code in an VBA script.

I need to change the Directory where to write the PDF file,
Paper direction, Image compression options, Paper size via VBA (from Power Point)

Currect Code goes like this ....

' ********************************************************
    ' (4)   Start Printing of the PowerPoint File as PDF
    ' Question 1:  I want to set the PDF printer parameter
    ' Question 2:  I want to set the PDF output directory
    ' ********************************************************
           
    With ActivePresentation.PrintOptions
        ' .RangeType = ppPrintAll
        .NumberOfCopies = 1
        .Collate = msoTrue
        .OutputType = ppPrintOutputSlides
        .PrintHiddenSlides = msoTrue
        .PrintColorType = ppPrintColor
        .FitToPage = msoTrue
        .FrameSlides = msoFalse
        .ActivePrinter = "Acrobat Distiller"
        .PrintInBackground = False
        .RangeType = ppPrintSlideRange
        ' With .Ranges
            ' ********************************
            '  Options which pages to print ...
            '  1, 11 acc. this sample,
            '  pls. Change acc. your needs
            ' ********************************
            ' .Add 1, 11
       
        End With
    ActivePresentation.PrintOut From:=1, To:=11, Copies:=1, Collate:=False
 
 
0
Comment
Question by:BdLm
  • 3
6 Comments
 
LVL 19

Expert Comment

by:akoster
Comment Utility
I don't know IF you could supply a directory in which the pdf files will be created in vba, but I know a way to do the trick using batch files.

it's a little bit far off to call batch files by vba but it does work...
0
 
LVL 16

Expert Comment

by:jimbobmcgee
Comment Utility
Alternatively, if you know where the file is saved, you can use the File System Object to move it after it has been created...
0
 
LVL 16

Accepted Solution

by:
jimbobmcgee earned 100 total points
Comment Utility
Otherwise, the following link
     http://www.microsoft.com/AccessDev/Articles/GetzCh10.HTM

has a good all-round view of the printer system for Office.  It's written with Access in mind but I'm sure some of the concepts are still valid...
0
 
LVL 8

Author Comment

by:BdLm
Comment Utility
proposal:

i checked the Comment from jimbobmcgee, interessting link,
but I could not find the pdf specific
printer parameters, I think only one from adobe can help here?

Do I have some misunderstanding?
 
as jimbobmcgee made some efforts i propopse to give him the points, but file the solution as not solved.
0
 
LVL 16

Expert Comment

by:jimbobmcgee
Comment Utility
I imagine you would need to configure the page setup (paper size, orientation, etc) and printer (to Acrobat Distiller), as per the link, then send to the Acrobat Distiller to create the PDF.  I doubt the Acrobat Distiller can be configured via VBA, although, you may be able to send text to a window/dialog that the Distiller produces, using SendMessage API.

You might like to ask one of the more subclass-mided Experts here about hooking the Distiller dialog...

Thanks for the points.

J.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now