Sonderzeichen bei Datenserverupload werden nun entfernt.

This commit is contained in:
2023-06-26 10:53:26 +02:00
parent 9252a2adc8
commit 03e5c95cc7
5 changed files with 35 additions and 9 deletions

View File

@@ -12,6 +12,7 @@ Imports SDL
Imports System.Net
Imports System.Security.Policy
Imports System.Diagnostics.Eventing.Reader
Imports System.Runtime.InteropServices.ComTypes
Public Class VERAGRibbon
Dim LOGIN_OK = False
@@ -35,7 +36,8 @@ Public Class VERAGRibbon
Private Sub Ribbon1_Load(ByVal sender As System.Object, ByVal e As RibbonUIEventArgs) Handles MyBase.Load
cAllgemein.TESTSYSTEM = False
'cAllgemein.TESTSYSTEM = False
cAllgemein.TESTSYSTEM = True
LOGIN_OK = AVISO_Mail_Functions.initFirmaUser()
End Sub
@@ -138,6 +140,7 @@ Public Class AVISO_Mail_Functions
Dim strFileName As String = "E-Mail"
If mailItem.Subject IsNot Nothing AndAlso mailItem.Subject <> "" Then
strFileName = Left(Regex.Replace(mailItem.Subject, "[\/\\\:\?!€,&'\*\<\>\|""]", ""), 100).Replace("""", "").Replace(vbTab, " ") & ".msg"
strFileName = VERAG_PROG_ALLGEMEIN.cDATENSERVER.replaceInvalidCahr(strFileName)
End If
'Dim strFileName As String = "Mail.msg"
Dim pdf_mail = ""
@@ -602,8 +605,10 @@ Public Class AVISO_Mail_Functions
Try
If AvisoId > 0 Then
' The full path will place the email in the user's temporary folder
If bezeichnung = "" Then bezeichnung = Left(Regex.Replace(mailItem.Subject, "[\/\\\:\?\*\<\>\|""]", ""), 100).Replace("""", "").Replace(vbTab, " ") & ".msg"
bezeichnung = VERAG_PROG_ALLGEMEIN.cDATENSERVER.replaceInvalidCahr(bezeichnung)
Dim strTmpPath As String = System.IO.Path.GetTempPath() & bezeichnung & If(bezeichnung.EndsWith(".msg"), "", ".msg")
' Save the email to the user's temp folder and convert it to a .MSG
'Dim cnt = 0
@@ -623,6 +628,7 @@ Public Class AVISO_Mail_Functions
' Clean up the temporary .MSG file from the user's temporary folder
System.IO.File.Delete(strTmpPath)
End If
Catch ex As Exception
MsgBox(ex.Message & ex.StackTrace)
Finally
@@ -636,9 +642,13 @@ Public Class AVISO_Mail_Functions
Try
If AvisoId > 0 Then
If bezeichnung = "" Then bezeichnung = Left(Regex.Replace(mailItem.Subject, "[\/\\\:\?\*\<\>\|""]", ""), 100).Replace("""", "").Replace(vbTab, " ") & ".msg"
Dim strTmpPath As String = System.IO.Path.GetTempPath() & bezeichnung & If(bezeichnung.EndsWith(".msg"), "", ".msg")
If bezeichnung = "" Then
bezeichnung = Left(Regex.Replace(mailItem.Subject, "[\/\\\:\?\*\<\>\|""]", ""), 100).Replace("""", "").Replace(vbTab, " ") & ".msg"
End If
bezeichnung = VERAG_PROG_ALLGEMEIN.cDATENSERVER.replaceInvalidCahr(bezeichnung)
Dim strTmpPath As String = System.IO.Path.GetTempPath() & bezeichnung & If(bezeichnung.EndsWith(".msg"), "", ".msg")
mailItem.SaveAs(strTmpPath, Outlook.OlSaveAsType.olMSG)