Vb,Net Event Macro - Run On Save Problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Can anybody help??
I have the following Vb.Net source code that, eventually, will convert an Inventor "idw" file to a "pdf" file.
Private Sub m_applicationEvents_OnSaveDocument(ByVal DocumentObject As Inventor._Document, ByVal BeforeOrAfter As Inventor.EventTimingEnum, ByVal Context As Inventor.NameValueMap, ByRef HandlingCode As Inventor.HandlingCodeEnum) Handles m_applicationEvents.OnSaveDocument
Try
If BeforeOrAfter = EventTimingEnum.kBefore Then
PartNumber = LCase(DocumentObject.DisplayName)
If Instr(PartNumber, "idw") > 0 Then
DrawingFolderPath = "C:\Users\djsmi\OneDrive\Desktop\"
PdfFileName = Replace(PartNumber, "idw", "pdf")
PdfFileName = DrawingFolderPath + PdfFileName
MsgBox("Pdf File Name = " + PdfFileName)
'oDoc.SaveAs(PdfFileName, True)
End If
End If
Catch ex As Exception
End Try
End Sub
Does anybody know how I can incorporate the line shown in RED so that it saves the Pdf file?
Many thanks in advance!!!
Darren