Message 1 of 3
iLogic Print Issues with Windows 11
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Anyone having issues with ilogic print rules that use " Import System.Windows.Forms" with Windows 11? it opens the Window dialog box looking only at my desktop. Will not allow me access to any other location.
Import System.Windows.Forms
' Creates a 'folder browser' to allow user to pick a directory location' This selected directory location is then used for a PDF export operation ' Get current location of this file Dim ExportPath As String = ThisDoc.Path oFolder = "C:\Work\Designs\CIW Check Print\" ' Check that this file has been saved and actually exists on disk If String.IsNullOrEmpty(ExportPath) Then MsgBox("This file has not yet been saved and doesn't exist on disk! - please save it first",64, "Formsprag iLogic") Return End If ' Define folder browse dialog Dim Dialog = New FolderBrowserDialog() ' Set options for folder browser dialog Dialog.SelectedPath = ExportPath Dialog.ShowNewFolderButton = True Dialog.Description = "Choose Folder for Export..." ' Show dialog box If DialogResult.OK = Dialog.ShowDialog() Then ' User clicked 'ok' on dialog box - capture the export path ExportPath = Dialog.SelectedPath & "\" Else ' User clicked 'cancel' on dialog box - exit Return End If oFileName = ThisDoc.FileName(False) 'without extension oRevNum = iProperties.Value("Custom", "REV LEVEL") Select Case MsgBox("Save current PDF as CHECK SET?", vbYesNo, "IS THE PDF FOR RELEASE OR CHECK? ") Case vbYes ExportFilename = oFileName & " CHECK SET" & ".pdf" ExportPath = oFolder 'Check for the ExportPath folder and create it if it does not exist If Not System.IO.Directory.Exists(oFolder) Then System.IO.Directory.CreateDirectory(oFolder) End If Case vbNo ExportFilename = oFileName & " REV-" & oRevNum & ".pdf" ExportPath = Dialog.SelectedPath & "\" End Select Shell("explorer.exe " & oFolder, vbNormalFocus) '' Define the filename of the file to be exported '' In this Case it Is a PDF file extension 'ExportFilename = oFileName & ".pdf" 'oPDFAddIn = ThisApplication.ApplicationAddIns.ItemById _ '("{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}") 'oDocument = ThisApplication.ActiveDocument 'oContext = ThisApplication.TransientObjects.CreateTranslationContext 'oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism 'oOptions = ThisApplication.TransientObjects.CreateNameValueMap 'oDataMedium = ThisApplication.TransientObjects.CreateDataMedium ''set PDF Options 'If oPDFAddIn.HasSaveCopyAsOptions(oDataMedium, oContext, oOptions) Then 'oOptions.Value("All_Color_AS_Black") = 1 'oOptions.Value("Remove_Line_Weights") = 1 'oOptions.Value("Vector_Resolution") = 400 'oOptions.Value("Sheet_Range") = Inventor.PrintRangeEnum.kPrintSheetRange 'End If ' Do export operation (using save as) Try ThisDoc.Document.SaveAs(ExportPath & ExportFilename, True) Catch MsgBox("File export failed...", 64, "Formsprag iLogic") End Try ThisDoc.Launch(ExportPath & ExportFilename)