Hi all
I created a macro that allows me to create a PDF of my drawings with a prefix and a second PDF with a prefix followed by "ADV",
My problem is the following on the second PDF I would like it to be only the first page of my layout, because when saving as you can tell the desired pages or not but in VBA I don't know how to do it.
Currently I use Acrobat that I open from my macro to delete the last two
Below is my macro:
*****************************************************************************
Sub main()
Dim SwApp As Object
Dim Part As Object
Dim SelMgr As Object
Dim selObj As Object
Dim AcroApp As Acrobat.AcroApp
Set SwApp = CreateObject("SldWorks.Application")
Set Part = SwApp.ActiveDoc
Dim Clue As String
index = InputBox("index?")
Dim myModelView As Object
Set myModelView = Part.ActiveView
Dim target As Scripting.filesystemobject
Dim value As Scripting.file
Target Set = CreateObject("scripting.filesystemobject")
Set value = target.getfile(Part.GetPathName)
longstatus = Part.SaveAs3("U:\PDF to serve\" & target. GetBaseName(value) & "-" & index & ".pdf", 0, 0)
If MsgBox("ADV", vbYesNo, "Do I need a PDF for ADV?") = vbYes Then
longstatus = Part.SaveAs3("U:\PDF to serve\" & target. GetBaseName(value) & "-" & index & "-ADV" & ".pdf", 0, 0)
Shell ("C:\Program Files (x86)\Adobe\Acrobat 7.0\Acrobat\Acrobat.exe U:\PDF to be distributed\" & target. GetBaseName(value) & "-" & index & "-ADV" & ".pdf"), vbMaximizedFocus
End If
MsgBox ("Finish")
End Sub
*****************************************************************************
Thank you in advance for your answers
Julian.