Compare commits
2 Commits
69554d7fbd
...
b32fd431be
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b32fd431be | ||
|
|
a581d8c81a |
@@ -91,57 +91,56 @@ Public Class ClassFileDrop
|
|||||||
LOGGER.Info("Attachment File from Outlook could not be created")
|
LOGGER.Info("Attachment File from Outlook could not be created")
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
ElseIf e.Data.GetDataPresent("FileGroupDescriptor") Then
|
End If
|
||||||
Dim oApp As Outlook.Application
|
If e.Data.GetDataPresent("FileGroupDescriptor") Then
|
||||||
Try
|
Dim oApp As Outlook.Application
|
||||||
oApp = New Outlook.Application()
|
|
||||||
Catch ex As Exception
|
|
||||||
LOGGER.Error(ex)
|
|
||||||
MsgBox("Unexpected error in Initialisieren von Outlook-API:" & vbNewLine & ex.Message & vbNewLine & vbNewLine & "Evtl ist Outlook nicht in der dafür vorgesehenen For")
|
|
||||||
Return False
|
|
||||||
End Try
|
|
||||||
|
|
||||||
LOGGER.Info(" Drop of msg")
|
|
||||||
'supports a drop of a Outlook message
|
|
||||||
Dim myobj As Outlook.MailItem
|
|
||||||
For i As Integer = 1 To oApp.ActiveExplorer.Selection.Count
|
|
||||||
myobj = oApp.ActiveExplorer.Selection.Item(i)
|
|
||||||
Dim subj As String = myobj.Subject
|
|
||||||
If subj = "" Then
|
|
||||||
subj = "NO_SUBJECT"
|
|
||||||
End If
|
|
||||||
If subj.Contains("\") Then
|
|
||||||
subj = subj.Replace("\", "-")
|
|
||||||
End If
|
|
||||||
If subj.Contains("/") Then
|
|
||||||
subj = subj.Replace("/", "-")
|
|
||||||
End If
|
|
||||||
'Sonderzeichen entfernen
|
|
||||||
subj = ClassFilehandle.InvalidCharacters(subj)
|
|
||||||
'hardcode a destination path for testing
|
|
||||||
Dim oFilename As String = IO.Path.Combine(Path.GetTempPath, subj + ".msg")
|
|
||||||
oFilename = oFilename.Replace("?", "")
|
|
||||||
oFilename = oFilename.Replace("!", "")
|
|
||||||
oFilename = oFilename.Replace("%", "")
|
|
||||||
oFilename = oFilename.Replace("$", "")
|
|
||||||
LOGGER.Info("Drop of msg - File:" & oFilename)
|
|
||||||
Try
|
Try
|
||||||
myobj.SaveAs(oFilename)
|
oApp = New Outlook.Application()
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
LOGGER.Error(ex)
|
LOGGER.Error(ex)
|
||||||
MsgBox("Die Email konnte aufgrund einer Sicherheitseinstellung im Outlook nicht abgelegt werden! " &
|
MsgBox("Unexpected error in Initialisieren von Outlook-API:" & vbNewLine & ex.Message & vbNewLine & vbNewLine & "Evtl ist Outlook nicht in der dafür vorgesehenen For")
|
||||||
"Bitte wenden Sie sich an Ihren Administrator, " &
|
Return False
|
||||||
"um den programmatischen Zugriff auf Outlook zuzulassen. " &
|
|
||||||
"Weitere Informationen finden Sie im Log.", MsgBoxStyle.Critical, "Global Indexer")
|
|
||||||
End Try
|
End Try
|
||||||
|
|
||||||
ReDim Preserve files_dropped(i)
|
LOGGER.Info(" Drop of msg")
|
||||||
files_dropped(i) = "|OUTLOOK_MESSAGE|" & oFilename
|
'supports a drop of a Outlook message
|
||||||
Next
|
Dim myobj As Outlook.MailItem
|
||||||
Return True
|
For i As Integer = 1 To oApp.ActiveExplorer.Selection.Count
|
||||||
|
myobj = oApp.ActiveExplorer.Selection.Item(i)
|
||||||
|
Dim subj As String = myobj.Subject
|
||||||
|
If subj = "" Then
|
||||||
|
subj = "NO_SUBJECT"
|
||||||
|
End If
|
||||||
|
If subj.Contains("\") Then
|
||||||
|
subj = subj.Replace("\", "-")
|
||||||
|
End If
|
||||||
|
If subj.Contains("/") Then
|
||||||
|
subj = subj.Replace("/", "-")
|
||||||
|
End If
|
||||||
|
'Sonderzeichen entfernen
|
||||||
|
subj = ClassFilehandle.InvalidCharacters(subj)
|
||||||
|
'hardcode a destination path for testing
|
||||||
|
Dim oFilename As String = IO.Path.Combine(Path.GetTempPath, subj + ".msg")
|
||||||
|
oFilename = oFilename.Replace("?", "")
|
||||||
|
oFilename = oFilename.Replace("!", "")
|
||||||
|
oFilename = oFilename.Replace("%", "")
|
||||||
|
oFilename = oFilename.Replace("$", "")
|
||||||
|
LOGGER.Info("Drop of msg - File:" & oFilename)
|
||||||
|
Try
|
||||||
|
myobj.SaveAs(oFilename)
|
||||||
|
Catch ex As Exception
|
||||||
|
LOGGER.Error(ex)
|
||||||
|
MsgBox("Die Email konnte aufgrund einer Sicherheitseinstellung im Outlook nicht abgelegt werden! " &
|
||||||
|
"Bitte wenden Sie sich an Ihren Administrator, " &
|
||||||
|
"um den programmatischen Zugriff auf Outlook zuzulassen. " &
|
||||||
|
"Weitere Informationen finden Sie im Log.", MsgBoxStyle.Critical, "Global Indexer")
|
||||||
|
End Try
|
||||||
|
|
||||||
|
ReDim Preserve files_dropped(i)
|
||||||
|
files_dropped(i) = "|OUTLOOK_MESSAGE|" & oFilename
|
||||||
|
Next
|
||||||
|
Return True
|
||||||
'Drop eines Outlook Attachments
|
'Drop eines Outlook Attachments
|
||||||
Else
|
|
||||||
Return False
|
|
||||||
End If
|
End If
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
MsgBox("Error in Drop-File" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
MsgBox("Error in Drop-File" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ Imports System.Runtime.InteropServices
|
|||||||
<Assembly: AssemblyCompany("Digital Data")>
|
<Assembly: AssemblyCompany("Digital Data")>
|
||||||
<Assembly: AssemblyProduct("Global Indexer")>
|
<Assembly: AssemblyProduct("Global Indexer")>
|
||||||
<Assembly: AssemblyCopyright("Copyright © 2021")>
|
<Assembly: AssemblyCopyright("Copyright © 2021")>
|
||||||
<Assembly: AssemblyTrademark("2408")>
|
<Assembly: AssemblyTrademark("2409")>
|
||||||
|
|
||||||
<Assembly: ComVisible(False)>
|
<Assembly: ComVisible(False)>
|
||||||
|
|
||||||
@@ -33,7 +33,7 @@ Imports System.Runtime.InteropServices
|
|||||||
' übernehmen, indem Sie "*" eingeben:
|
' übernehmen, indem Sie "*" eingeben:
|
||||||
' <Assembly: AssemblyVersion("1.0.*")>
|
' <Assembly: AssemblyVersion("1.0.*")>
|
||||||
|
|
||||||
<Assembly: AssemblyVersion("2.4.0.8")>
|
<Assembly: AssemblyVersion("2.4.0.9")>
|
||||||
<Assembly: AssemblyFileVersion("1.0.0.0")>
|
<Assembly: AssemblyFileVersion("1.0.0.0")>
|
||||||
|
|
||||||
<Assembly: NeutralResourcesLanguageAttribute("")>
|
<Assembly: NeutralResourcesLanguageAttribute("")>
|
||||||
Reference in New Issue
Block a user