Prüfung beim MailItem mittels TryCast, ob Mailobjekt nicht beschädigt ist.
This commit is contained in:
@@ -36,7 +36,7 @@
|
|||||||
<PublishUrl>\\ftps.verag.ag\g\ftp\programme\VERAGAddin\</PublishUrl>
|
<PublishUrl>\\ftps.verag.ag\g\ftp\programme\VERAGAddin\</PublishUrl>
|
||||||
<InstallUrl>http://ftps.verag.ag/VERAGAddin/</InstallUrl>
|
<InstallUrl>http://ftps.verag.ag/VERAGAddin/</InstallUrl>
|
||||||
<TargetCulture>de</TargetCulture>
|
<TargetCulture>de</TargetCulture>
|
||||||
<ApplicationVersion>1.0.1.98</ApplicationVersion>
|
<ApplicationVersion>1.0.1.99</ApplicationVersion>
|
||||||
<AutoIncrementApplicationRevision>true</AutoIncrementApplicationRevision>
|
<AutoIncrementApplicationRevision>true</AutoIncrementApplicationRevision>
|
||||||
<UpdateEnabled>true</UpdateEnabled>
|
<UpdateEnabled>true</UpdateEnabled>
|
||||||
<UpdateInterval>0</UpdateInterval>
|
<UpdateInterval>0</UpdateInterval>
|
||||||
|
|||||||
@@ -106,12 +106,21 @@ Public Class AVISO_Mail_Functions
|
|||||||
Dim explorer As Outlook.Explorer = Globals.ThisAddIn.Application.ActiveExplorer
|
Dim explorer As Outlook.Explorer = Globals.ThisAddIn.Application.ActiveExplorer
|
||||||
Dim selection As Outlook.Selection = explorer.Selection
|
Dim selection As Outlook.Selection = explorer.Selection
|
||||||
If selection.Count > 0 Then
|
If selection.Count > 0 Then
|
||||||
Dim selectedItem = selection(1)
|
Dim selectedItem As Object = selection(1)
|
||||||
Dim mailItem As Outlook.MailItem = selectedItem
|
|
||||||
mailItem = DirectCast(mailItem, Outlook.MailItem)
|
|
||||||
|
|
||||||
addMailToAviso(mailItem, isFormular)
|
Dim result = TryCast(selectedItem, Outlook.MailItem)
|
||||||
|
|
||||||
|
If result IsNot Nothing Then
|
||||||
|
|
||||||
|
Dim mailItem As Outlook.MailItem = selectedItem
|
||||||
|
mailItem = DirectCast(mailItem, Outlook.MailItem)
|
||||||
|
|
||||||
|
addMailToAviso(mailItem, isFormular)
|
||||||
|
Else
|
||||||
|
MsgBox("Die markierte Email kann nicht verarbeitet werden!" & vbNewLine & "Bitte andere Mail verwenden.")
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
MsgBox(ex.Message & ex.StackTrace)
|
MsgBox(ex.Message & ex.StackTrace)
|
||||||
End Try
|
End Try
|
||||||
|
|||||||
Reference in New Issue
Block a user