diff --git a/VERAGAddIn.sln b/VERAGAddIn.sln
index 58d67db..45d224a 100644
--- a/VERAGAddIn.sln
+++ b/VERAGAddIn.sln
@@ -1,15 +1,15 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2013
-VisualStudioVersion = 12.0.40629.0
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.30406.217
MinimumVisualStudioVersion = 10.0.40219.1
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "VERAGAddIn", "VERAGAddIn\VERAGAddIn.vbproj", "{D579F7A6-7D29-4295-B382-DA5F7EFB4528}"
EndProject
-Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "VERAG_PROG_ALLGEMEIN", "..\..\SDL\SDL\VERAG_PROG_ALLGEMEIN\VERAG_PROG_ALLGEMEIN.vbproj", "{A3B497BD-842C-4A2B-B398-ED1976849DF1}"
+Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "VERAG_PROG_ALLGEMEIN", "..\SDL\SDL\VERAG_PROG_ALLGEMEIN\VERAG_PROG_ALLGEMEIN.vbproj", "{A3B497BD-842C-4A2B-B398-ED1976849DF1}"
EndProject
-Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Gemeinsames", "..\..\AVISO\Aviso\Gemeinsames\Gemeinsames.vbproj", "{110C923B-CB02-4FD0-AF24-95E0F0EEEFF5}"
+Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Gemeinsames", "..\AVISO\Aviso\Gemeinsames\Gemeinsames.vbproj", "{110C923B-CB02-4FD0-AF24-95E0F0EEEFF5}"
EndProject
-Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Aviso", "..\..\AVISO\Aviso\Aviso\Aviso.vbproj", "{7BDD8C2F-2C9E-49F1-A365-3B1DA1C84991}"
+Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Aviso", "..\AVISO\Aviso\Aviso\Aviso.vbproj", "{7BDD8C2F-2C9E-49F1-A365-3B1DA1C84991}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -65,4 +65,7 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {45BA122D-A6FD-4A0F-B2B7-22921B1B1004}
+ EndGlobalSection
EndGlobal
diff --git a/VERAGAddIn/ThisAddIn.vb b/VERAGAddIn/ThisAddIn.vb
index c9a46ec..0791be4 100644
--- a/VERAGAddIn/ThisAddIn.vb
+++ b/VERAGAddIn/ThisAddIn.vb
@@ -1,18 +1,32 @@
Option Explicit On
Imports Microsoft.Office.Interop
+Imports System.Reflection
Imports System.Windows.Forms
Imports Microsoft.Office.Core
-Imports Microsoft.Office.Tools.Ribbon
+Imports System.Dynamic
'Option Private Module
'Imports Microsoft.Office.Core
Public Class ThisAddIn
Private WithEvents inspectors As Outlook.Inspectors
+ Private WithEvents Items As Outlook.Items
+ Private WithEvents currentExplorer As Outlook.Explorer
+ Public Shared WithEvents SharedExplorer As Outlook.Explorer
+ Public Shared WithEvents SelectedMail As Outlook.MailItem
+ Public Shared WithEvents MapiPath As Outlook.MAPIFolder
+ Public Shared MailOpened As Boolean = False
+ Public Shared WithEvents oufolder As Outlook.Folder
+
+ ' Dim fldr As Outlook.Folder
+ 'Dim mapifldr As Outlook.MAPIFolder
+
Private Sub ThisAddIn_Startup(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Startup
inspectors = Me.Application.Inspectors
+ currentExplorer = Me.Application.ActiveExplorer
+ SharedExplorer = currentExplorer
AddHandler VERAGRibbon.bla, Sub()
' MsgBox("JOAS")
@@ -23,10 +37,117 @@ Public Class ThisAddIn
' MsgBox("JOAS")
' TestPrintFirstPage()
End Sub
+
End Sub
Private APP = Me.Application
-
+ Public Shared Sub Folder_BeforeItemMove(ByVal anItem As Object, ByVal aMoveToFolder As Outlook.MAPIFolder, ByRef Cancel As Boolean) Handles oufolder.BeforeItemMove
+ Dim mailItem As Outlook.MailItem = (TryCast(anItem, Outlook.MailItem))
+ MailChanged(Nothing, mailItem, "verschoben nach " & aMoveToFolder.FullFolderPath.ToString & " von: ")
+ End Sub
+
+
+ Private Sub CurrentExplorer_Event() Handles currentExplorer.SelectionChange
+ 'Dim oldmailitem As Outlook.MailItem = SelectedMail
+
+ ' mapifldr = Application.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox)
+
+
+ Dim selectedFolder As Outlook.MAPIFolder = Me.Application.ActiveExplorer().CurrentFolder
+ Dim expMessage As String = "Your current folder is " & selectedFolder.Name & "." & vbLf
+ Dim itemMessage As String = "Item is unknown."
+
+ oufolder = CType(Application.GetNamespace("MAPI").GetFolderFromID(selectedFolder.EntryID), Outlook.Folder)
+
+ Try
+
+ If Me.Application.ActiveExplorer().Selection.Count > 0 Then
+ Dim selObject As Object = Me.Application.ActiveExplorer().Selection(1)
+
+ If TypeOf selObject Is Outlook.MailItem Then
+ Dim mailItem As Outlook.MailItem = (TryCast(selObject, Outlook.MailItem))
+ itemMessage = "The item is an e-mail message." & " The subject is " & mailItem.Subject & "."
+ If mailItem Is SelectedMail Then
+ Exit Sub
+ Else
+ MailOpened = False
+ End If
+ SelectedMail = mailItem
+ 'mailItem.Display(False)
+ ElseIf TypeOf selObject Is Outlook.ContactItem Then
+ Dim contactItem As Outlook.ContactItem = (TryCast(selObject, Outlook.ContactItem))
+ itemMessage = "The item is a contact." & " The full name is " & contactItem.Subject & "."
+ 'contactItem.Display(False)
+ ElseIf TypeOf selObject Is Outlook.AppointmentItem Then
+ Dim apptItem As Outlook.AppointmentItem = (TryCast(selObject, Outlook.AppointmentItem))
+ 'itemMessage = "The item is an appointment." & " The subject is " & apptItem.Subject & "."
+ ElseIf TypeOf selObject Is Outlook.TaskItem Then
+ Dim taskItem As Outlook.TaskItem = (TryCast(selObject, Outlook.TaskItem))
+ 'itemMessage = "The item is a task. The body is " & taskItem.Body & "."
+ ElseIf TypeOf selObject Is Outlook.MeetingItem Then
+ Dim meetingItem As Outlook.MeetingItem = (TryCast(selObject, Outlook.MeetingItem))
+ 'itemMessage = "The item is a meeting item. " & "The subject is " & meetingItem.Subject & "."
+ End If
+ End If
+
+ expMessage = expMessage + itemMessage
+ Catch ex As Exception
+ expMessage = ex.Message
+ End Try
+
+ MapiPath = selectedFolder.Parent
+
+
+ End Sub
+
+
+ Public Shared Sub MailIsChanged(sender As System.Object) Handles SelectedMail.PropertyChange
+ 'If MailOpened = False Then
+ MailChanged(sender)
+ 'End If
+ End Sub
+
+
+ Public Shared Sub MailChanged(sender As System.Object, Optional ByRef Mail As Outlook.MailItem = Nothing, Optional ByVal Commenttext As String = "")
+ ' If MailOpened = True And SendFromOpenMail = True Then RemoveHandler SelectedMail.PropertyChange, AddressOf MailChanged
+ 'MsgBox(MailOpened)
+ Dim Changes As String = Date.Now.ToString & ": "
+ If Mail Is Nothing Then Mail = SelectedMail
+
+ If sender IsNot Nothing Then
+ Select Case sender.ToString
+ Case "Categories"
+ If Mail.Categories IsNot Nothing Then
+ Changes &= "Kategorie geändert auf " & Mail.Categories.ToString & " von: "
+ Else
+ Changes &= "Kategorie gelöscht von: "
+ End If
+
+ Case "UnRead"
+ If Mail.UnRead = True Then
+ Changes &= "Mail als ungelesen markiert von: "
+ Else
+ Changes &= "Mail als gelesen markiert von: "
+ End If
+
+ 'Case "FlagStatus"
+ ' MsgBox("FlagStatus")
+ Case Else
+ Exit Sub
+ End Select
+ Else
+ Changes &= Commenttext
+ End If
+
+ Changes &= " " & VERAG_PROG_ALLGEMEIN.cAllgemein.USRNAME
+
+ Mail.FormDescription.Comment &= Changes & vbCrLf
+ Mail.Save()
+ ' MsgBox(Changes)
+
+ End Sub
+
+
Public Sub TestPrintFirstPage()
Dim Mail As Outlook.MailItem
diff --git a/VERAGAddIn/VERAGAddIn.vbproj b/VERAGAddIn/VERAGAddIn.vbproj
index 6b8b7d1..4b971f2 100644
--- a/VERAGAddIn/VERAGAddIn.vbproj
+++ b/VERAGAddIn/VERAGAddIn.vbproj
@@ -167,6 +167,9 @@
+
+ ..\..\SDL\SDL\VERAG_PROG_ALLGEMEIN\bin\Debug\VERAG_PROG_ALLGEMEIN.dll
+
@@ -216,6 +219,7 @@
-->
+
frmAvisoAnfügen.vb
@@ -319,18 +323,14 @@
-
+
{7bdd8c2f-2c9e-49f1-a365-3b1da1c84991}
Aviso
-
+
{110c923b-cb02-4fd0-af24-95e0f0eeeff5}
Gemeinsames
-
- {a3b497bd-842c-4a2b-b398-ed1976849df1}
- VERAG_PROG_ALLGEMEIN
-
@@ -377,7 +377,7 @@
- D08413FBDF065D4AB51DA9E7705AC1B0DA0041F2
+ 443CA3745EE904EED98572A89099259301BA06D1
false
@@ -396,7 +396,7 @@
-
+
diff --git a/VERAGAddIn/cMailItem.vb b/VERAGAddIn/cMailItem.vb
new file mode 100644
index 0000000..639f224
--- /dev/null
+++ b/VERAGAddIn/cMailItem.vb
@@ -0,0 +1,3 @@
+Public Class cMailItem
+
+End Class
diff --git a/VERAGAddIn/rbnMailItem.Designer.vb b/VERAGAddIn/rbnMailItem.Designer.vb
index 5a8b61c..72c2f65 100644
--- a/VERAGAddIn/rbnMailItem.Designer.vb
+++ b/VERAGAddIn/rbnMailItem.Designer.vb
@@ -41,10 +41,14 @@
'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
_
Private Sub InitializeComponent()
+ Me.components = New System.ComponentModel.Container()
Me.Tab1 = Me.Factory.CreateRibbonTab
Me.Group1 = Me.Factory.CreateRibbonGroup
Me.Button1 = Me.Factory.CreateRibbonButton
Me.Button2 = Me.Factory.CreateRibbonButton
+ Me.btnInfo = Me.Factory.CreateRibbonButton
+ Me.btnUnsichtbar = Me.Factory.CreateRibbonButton
+ Me.NotifyIcon1 = New System.Windows.Forms.NotifyIcon(Me.components)
Me.Tab1.SuspendLayout()
Me.Group1.SuspendLayout()
Me.SuspendLayout()
@@ -60,6 +64,8 @@
'
Me.Group1.Items.Add(Me.Button1)
Me.Group1.Items.Add(Me.Button2)
+ Me.Group1.Items.Add(Me.btnInfo)
+ Me.Group1.Items.Add(Me.btnUnsichtbar)
Me.Group1.Label = "AVISO"
Me.Group1.Name = "Group1"
'
@@ -79,6 +85,22 @@
Me.Button2.Name = "Button2"
Me.Button2.ShowImage = True
'
+ 'btnInfo
+ '
+ Me.btnInfo.Label = "?"
+ Me.btnInfo.Name = "btnInfo"
+ '
+ 'btnUnsichtbar
+ '
+ Me.btnUnsichtbar.Label = "i"
+ Me.btnUnsichtbar.Name = "btnUnsichtbar"
+ Me.btnUnsichtbar.Visible = False
+ '
+ 'NotifyIcon1
+ '
+ Me.NotifyIcon1.Text = "NotifyIcon1"
+ Me.NotifyIcon1.Visible = True
+ '
'rbnMailItem
'
Me.Name = "rbnMailItem"
@@ -98,6 +120,9 @@
Friend WithEvents Group1 As Microsoft.Office.Tools.Ribbon.RibbonGroup
Friend WithEvents Button1 As Microsoft.Office.Tools.Ribbon.RibbonButton
Friend WithEvents Button2 As Microsoft.Office.Tools.Ribbon.RibbonButton
+ Friend WithEvents btnInfo As Microsoft.Office.Tools.Ribbon.RibbonButton
+ Friend WithEvents NotifyIcon1 As Windows.Forms.NotifyIcon
+ Friend WithEvents btnUnsichtbar As Microsoft.Office.Tools.Ribbon.RibbonButton
End Class
Partial Class ThisRibbonCollection
diff --git a/VERAGAddIn/rbnMailItem.resx b/VERAGAddIn/rbnMailItem.resx
index 1af7de1..b6a2749 100644
--- a/VERAGAddIn/rbnMailItem.resx
+++ b/VERAGAddIn/rbnMailItem.resx
@@ -117,4 +117,7 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ 17, 17
+
\ No newline at end of file
diff --git a/VERAGAddIn/rbnMailItem.vb b/VERAGAddIn/rbnMailItem.vb
index 75a92cb..9848fd1 100644
--- a/VERAGAddIn/rbnMailItem.vb
+++ b/VERAGAddIn/rbnMailItem.vb
@@ -1,12 +1,27 @@
-Imports Microsoft.Office.Tools.Ribbon
+Option Explicit On
+
+
+Imports Microsoft.Office.Tools.Ribbon
+Imports Microsoft.Office.Interop
+Imports System.Windows.Forms
Public Class rbnMailItem
Dim LOGIN_OK As Boolean = False
+ Dim LoadInspector As Outlook.Inspector
Public Shared Event bla()
+ Public Shared WithEvents ThisMail As Outlook.MailItem
+ Dim currentexplorer As Outlook.Explorer
+
Private Sub rbnMailItem_Load(ByVal sender As System.Object, ByVal e As RibbonUIEventArgs) Handles MyBase.Load
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = False
LOGIN_OK = AVISO_Mail_Functions.initFirmaUser()
+ currentexplorer = ThisAddIn.SharedExplorer
+
+ Dim selObject As Object = currentexplorer.Selection(1)
+ ThisMail = (TryCast(selObject, Outlook.MailItem))
End Sub
+
+
Private Function CreateRibbonDropDownItem() As RibbonDropDownItem
Return Me.Factory.CreateRibbonDropDownItem()
End Function
@@ -37,4 +52,28 @@ Public Class rbnMailItem
End Try
End If
End Sub
+
+ Private Sub btnInfo_Click(sender As Object, e As RibbonControlEventArgs) Handles btnInfo.Click
+ ' MsgBox(VERAG_PROG_ALLGEMEIN.cAllgemein.USRKURZNAME)
+ Try
+ Dim INSPECTOR As Outlook.Inspector = e.Control.Context
+
+ MsgBox(INSPECTOR.CurrentItem.FormDescription.Comment)
+ Catch
+ MsgBox("Fehler beim Anzeigen der Mailinformationen.")
+ End Try
+ End Sub
+
+ Private Sub btnUnsichtbar_Click(sender As Object, e As RibbonControlEventArgs) Handles btnUnsichtbar.Click
+ LoadInspector = e.Control.Context
+ ThisMail = LoadInspector.CurrentItem
+ End Sub
+
+ Public Shared Sub MailChanged(sender As System.Object) Handles ThisMail.PropertyChange
+ If ThisAddIn.SelectedMail.ConversationIndex = ThisMail.ConversationIndex Then
+ Exit Sub
+ Else
+ ThisAddIn.MailChanged(sender, ThisMail)
+ End If
+ End Sub
End Class
diff --git a/VERAGAddIn/rbnVERAG.Designer.vb b/VERAGAddIn/rbnVERAG.Designer.vb
index 5949b37..89636aa 100644
--- a/VERAGAddIn/rbnVERAG.Designer.vb
+++ b/VERAGAddIn/rbnVERAG.Designer.vb
@@ -1,7 +1,7 @@
Partial Class VERAGRibbon
Inherits Microsoft.Office.Tools.Ribbon.RibbonBase
- _
+
Public Sub New(ByVal container As System.ComponentModel.IContainer)
MyClass.New()
@@ -12,7 +12,7 @@
End Sub
- _
+
Public Sub New()
MyBase.New(Globals.Factory.GetRibbonFactory())
@@ -22,7 +22,7 @@
End Sub
'Die Komponente überschreibt den Löschvorgang zum Bereinigen der Komponentenliste.
- _
+
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
@@ -39,7 +39,7 @@
'Hinweis: Die folgende Prozedur ist für den Komponenten-Designer erforderlich.
'Das Bearbeiten ist mit dem Komponenten-Designer möglich.
'Nehmen Sie keine Änderungen mit dem Code-Editor vor.
- _
+
Private Sub InitializeComponent()
Me.Tab1 = Me.Factory.CreateRibbonTab
Me.VERAG = Me.Factory.CreateRibbonGroup
diff --git a/VERAGAddIn/rbnVERAG.vb b/VERAGAddIn/rbnVERAG.vb
index 06c758d..59409d1 100644
--- a/VERAGAddIn/rbnVERAG.vb
+++ b/VERAGAddIn/rbnVERAG.vb
@@ -256,6 +256,23 @@ Public Class AVISO_Mail_Functions
End Try
End Sub
+ Shared Sub MovedMail()
+ Try
+ Dim explorer As Outlook.Explorer = Globals.ThisAddIn.Application.ActiveExplorer
+ Dim selection As Outlook.Selection = explorer.Selection
+ If selection.Count > 0 Then
+ Dim selectedItem = selection(1)
+ Dim mailItem As Outlook.MailItem = selectedItem
+ If mailItem IsNot Nothing Then
+ MsgBox("Du bist hier angelangt!")
+ End If
+
+ End If
+ Catch ex As Exception
+ MsgBox(ex.Message & ex.StackTrace)
+ End Try
+ End Sub
+
Shared Function getFirmaFromToMail(ToMail As String)
If ToMail.Contains("@verag") Then Return "VERAG"