Message 1 of 4

Not applicable
08-19-2020
05:30 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Can someone give me a pointer. I am using this doe I cobbled together/pinched and trying to get the filename to be (mostly) predetermined by user input on form. Got it all working, and the saveas dialog is prepopulated with the coirrect ino...but the file is not actually saving.???
Goes through the motions but nothing is happening. Any ideas?
If ThisDoc.Path = "" Then 'If Document has Not been saved before... 'SAVE AS DIALOG BOX 'define the active document oDoc = ThisDoc.Document 'create a file dialog box Dim oFileDlg As Inventor.FileDialog = Nothing InventorVb.Application.CreateFileDialog(oFileDlg) 'Set dialog filter 'oFileDlg.Filter = "Autodesk Inventor Part Files (*.ipt)|*.ipt" 'set the directory to open the dialog at 'oFileDlg.InitialDirectory = ThisDoc.WorkspacePath() 'set the file name string to use in the input box as the value entered in Excel Spreadsheet oFileDlg.FileName = iProperties.Value("Project","Project") & "-" & iProperties.Value("Summary","Category")& "-XXXX-" & iProperties.Value("Summary","Title") 'work with an error created by the user backing out of the save oFileDlg.CancelError = True On Error Resume Next 'specify the file dialog as a save dialog (rather than a open dialog) oFileDlg.ShowSave() 'catch an empty string in the imput If Err.Number <> 0 Then MessageBox.Show("No File Saved.", "Save: Dialog Canceled") ElseIf oFileDlg.FileName <> "" Then 'save the file oDoc.SaveAs(iProperties.Value("Project","Project") & "-" & iProperties.Value("Summary","Category"), False) 'True = Save As Copy & False = Save As Else End If End If
Solved! Go to Solution.