This commit is contained in:
2026-04-27 08:14:19 +02:00
2 changed files with 21 additions and 7 deletions

View File

@@ -448,7 +448,12 @@ Public Class frmLaufzettel
End If End If
For Each p In paths For Each p In paths
Mail.Attachments.Add(p, Microsoft.Office.Interop.Outlook.OlAttachmentType.olByValue, , "Gestellungsliste.pdf") If p <> "" Then
Dim fileInfo As New IO.FileInfo(p)
If Not fileInfo.Exists Then Continue For
Mail.Attachments.Add(p, Microsoft.Office.Interop.Outlook.OlAttachmentType.olByValue, , "Gestellungsliste.pdf")
End If
Next Next
@@ -508,7 +513,13 @@ Public Class frmLaufzettel
Try Try
For Each p In paths For Each p In paths
VERAG_PROG_ALLGEMEIN.cFormularManager.PrintViaSpirePDF({p}, cboPrinter.SelectedItem.ToString) If p <> "" Then
If Not System.IO.Directory.Exists(p) Then Continue For
Dim fileInfo As New IO.FileInfo(p)
If Not fileInfo.Exists Then Continue For
VERAG_PROG_ALLGEMEIN.cFormularManager.PrintViaSpirePDF({p}, cboPrinter.SelectedItem.ToString)
End If
Next Next
'If paths.Count = 1 Then '1 Gestellungsliste 'If paths.Count = 1 Then '1 Gestellungsliste
@@ -526,16 +537,18 @@ Public Class frmLaufzettel
Catch ex As Exception Catch ex As Exception
MsgBox("Fehler beim erstellen der E-Mail:" & vbNewLine & ex.Message & ex.StackTrace) VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name,, )
End Try End Try
Else Else
Dim path = SDL.FormularManagerNEU.LaufzettelZollDE(AvisoID, False,, digitalDruck) Dim path = SDL.FormularManagerNEU.LaufzettelZollDE(AvisoID, False,, digitalDruck)
If path <> "" Then If path <> "" Then
'Process.Start(path) Dim fileInfo As New IO.FileInfo(path)
VERAG_PROG_ALLGEMEIN.cFormularManager.PrintViaSpirePDF({path}, cboPrinter.SelectedItem.ToString) If fileInfo.Exists Then
'Process.Start(path)
VERAG_PROG_ALLGEMEIN.cFormularManager.PrintViaSpirePDF({path}, cboPrinter.SelectedItem.ToString)
End If
End If End If
End If End If
If cbxDokumenteDrucken.Checked Then If cbxDokumenteDrucken.Checked Then

View File

@@ -4958,7 +4958,8 @@ Public Class frmSendungsdetailsNEU
For Each r As DataGridViewRow In dgvAnhang.SelectedRows For Each r As DataGridViewRow In dgvAnhang.SelectedRows
files.Add(VERAG_PROG_ALLGEMEIN.cDATENSERVER.GET_PDFPath_BY_DocID(r.Cells("anh_docId").Value))
If r.Cells("anh_Typ").Value.ToString.ToLower = "pdf" Then files.Add(VERAG_PROG_ALLGEMEIN.cDATENSERVER.GET_PDFPath_BY_DocID(r.Cells("anh_docId").Value))
Next Next
VERAG_PROG_ALLGEMEIN.cFormularManager.mergePDFs(files, outputFile) VERAG_PROG_ALLGEMEIN.cFormularManager.mergePDFs(files, outputFile)