diff --git a/EB_Creator/MyService.vb b/EB_Creator/MyService.vb index eff9b78..ab1a61f 100644 --- a/EB_Creator/MyService.vb +++ b/EB_Creator/MyService.vb @@ -349,15 +349,13 @@ Public Class MyService TempFile = "" If File.Exists(oOriginFile) = False Then If Not IsNothing(WINDREAM) And oOriginFile.StartsWith("\\windream\objects") Then - ' Dim oWmObj As WINDREAMLib.IWMObject6 = WINDREAM.GetFileByPath(oOriginFile.Replace("\\windream\objects", "")) - 'If Not IsNothing(oWmObj) Then Logger.Debug($"Trying to export WMFile: {oOriginFile}...") Dim oReturn = WINDREAM.Export_WMFile(oOriginFile, Path.GetTempPath()) + Logger.Debug($"Result of WINDREAM.Export_WMFile: [{oReturn.ToString}]") If oReturn <> "False" Then If File.Exists(oReturn) Then - oOriginFile = oReturn UsedTempFile = True - TempFile = oOriginFile + TempFile = oReturn Else Logger.Info($"TempFile not existing ### [{oReturn}]!") Delete_EB2bCreated(pDocID) @@ -381,14 +379,14 @@ Public Class MyService End If - If Not IsNothing(oOriginFile) Then + If Not IsNothing(TempFile) Then If File.Exists(My.Settings.Path2PDFTK) Then If Create_MyStempel(pDocID, GENID) = True Then 'Jetzt Stempeln des OriginalBeleges mit dem Stamp-Report - Dim oFilewithStamp = CreateStampedPDF(oOriginFile, pDocID, GENID) + Dim oFilewithStamp = CreateStampedPDF(TempFile, pDocID, GENID) If oFilewithStamp <> "" Then - If Concat_Files(pDocID, oOriginFile, GENID, Outputfilename, OutputFolder, oFilewithStamp, MyFreigabebericht) = True Then + If Concat_Files(pDocID, TempFile, GENID, Outputfilename, OutputFolder, oFilewithStamp, MyFreigabebericht) = True Then If pRerun = False Then Dim oInsert = $"INSERT INTO TBCUST_PM_RPT_CREATED (DocID,GEN_ID) VALUES ({Convert.ToInt64(pDocID)},'{GENID}')" MyDatabase.ExecuteNonQuery(oInsert)