Results 1 to 2 of 2

Thread: MS Project export to PDF via Macro

  1. #1
    Join Date
    May 2010
    Posts
    11

    MS Project export to PDF via Macro

    Hello

    I have created a report which I print to .pfd and email to many resources, each resource has a report which filters to show only their tasks.
    I would like to prepare all of the reports in separate .pdf files using a macro

    1. Is there a script which sets the active printer to be the 'pdf writer'
    2. Is there a script which sets the active printer back to the original printer
    3. Is there a script which fills in the "print to pdf" dialog box automatically with a path and filename? eg c:\Project\Published Files\"todays date" "Report name"

    Thanks

  2. #2
    Join Date
    Dec 2007
    Posts
    1,736

    Re: MS Project export to PDF via Macro

    I was able to find one script that should work:

    Code:
    Sub Print()
    '
    ' Macro2 Macro
    ' Macro recorded 7/16/2009 by Administrator
    '
    '
    Dim actprinter$
    Dim actprinter2$
    For i = 0 To 10
    On Error Resume Next
    actprinter = "PDF Writer on Ne" & Format$(i, "00") & ":"
    Application.ActivePrinter = actprinter
    'exit if we succeed
    If Err.Number = 0 Then Exit For
    Next i
    If Not Application.ActivePrinter Like "PDF Writer*" Then
    For i = 0 To 10
    On Error Resume Next
    actprinter2 = "Adobe PDF on Ne" & Format$(i, "00") & ":"
    Application.ActivePrinter = actprinter2
    'exit if we succeed
    If Err.Number = 0 Then Exit For
    Next i
    Exit Sub
    End If
     
    Selection.PrintOut Copies:=1, ActivePrinter:=actprinter, Collate _
    :=True
    End Sub

Similar Threads

  1. MS Project 2007 Emailing Macro
    By dmpyne in forum Microsoft Project
    Replies: 1
    Last Post: 13-12-2011, 12:56 AM
  2. MS Project 2007 - macro buttons grayed out
    By jbarbara11@yahoo.com in forum Microsoft Project
    Replies: 1
    Last Post: 10-12-2011, 02:45 AM
  3. Need help with MS Project Macro!!!
    By meatloaf_o in forum Windows Software
    Replies: 1
    Last Post: 02-12-2011, 06:32 PM
  4. Import / Export across project plans
    By Landon in forum Microsoft Project
    Replies: 2
    Last Post: 15-10-2008, 08:35 AM
  5. Export project as a pdf file
    By GyanDev-Baba in forum Microsoft Project
    Replies: 2
    Last Post: 30-01-2008, 09:07 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,653,301,461.22678 seconds with 17 queries