Message 1 of 17
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi
I'm using follow code to generate PDF from drawings:
'------start of iLogic------- oPath = ThisDoc.Path doc = IO.Path.GetFileName(ThisDrawing.ModelDocument.FullFileName) oFileName = ThisDoc.FileName(False) 'without extension oRevNum = iProperties.Value(doc, "Custom", "rev") oProduct = iProperties.Value(doc, "Custom", "toode") oCurDate = iProperties.Value("Status", "Checked Date") 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 'get PDF target folder path oFolder = Left(oPath, InStrRev(oPath, "\")) 'Check for the PDF folder and create it if it does not exist If Not System.IO.Directory.Exists(oFolder) Then System.IO.Directory.CreateDirectory(oFolder) End If 'Set the PDF target file name oDataMedium.FileName = oFolder & "\" & oProduct & " - " & oRevNum & " - " & oCurDate &".pdf" 'Publish document oPDFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium) '------end of iLogic-------
In work, win10, everything works. In home, win11, i get this error:
Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))
Has anybody have any idea, what causes this?
Solved! Go to Solution.