Solved

VBA and Print as PDF Options

Posted on 2004-09-21
6
815 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
6 Comments
 
LVL 19

Expert Comment

by:Arno Koster
ID: 12111458
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
ID: 12111533
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
ID: 12111557
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
ID: 12563693
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
ID: 12812700
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

739 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