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
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