Message 1 of 4

Not applicable
03-02-2021
03:16 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, I am trying to create a ribbon button on a drawing to export the drawing as a PDF to a location and name the PDF as a custom iproperty that is contained in the part file.
My code right now pulls the iproperty from the drawing called "Part Number". I want it to pull a custom iproperty from the part called "Item Code".
Here's my code which is almost complete:
DrawingName = iProperties.Value("Project", "Part Number") DesiredPath = "C:\JACKRABBIT\INVENTOR TEMPLATES 2022\MISC\PDF" NewFileName = DesiredPath & "\" & DrawingName & ".pdf" 'check file name to see if it is used 'if it is, ask the user to overwrite 'if it's not, save the file question = MessageBox.Show("Is this a good file name?: " & DrawingName & ".pdf", "iLogic Question",MessageBoxButtons.YesNo,MessageBoxIcon.Question) If question=vbYes Then If System.IO.File.Exists(NewFileName) Then question = MessageBox.Show("File exists, do you want to overwrite?", "iLogic Question",MessageBoxButtons.YesNo,MessageBoxIcon.Question) If question = vbYes Then System.IO.File.Delete(NewFileName) ThisDoc.Document.SaveAs(NewFileName, True) Else If question =vbNo Then MessageBox.Show("File was not overwritten", "iLogic Message") End If Else ThisDoc.Document.SaveAs(NewFileName, True) End If Else If question=vbNo Then MessageBox.Show("Please fix Part Number") End If
Solved! Go to Solution.