This commit is contained in:
2019-09-10 14:16:02 +02:00
parent 5dc6ec54bd
commit 3a223f4418
10 changed files with 319 additions and 218 deletions

View File

@@ -35,8 +35,8 @@ Imports System.Security
' übernehmen, indem Sie "*" eingeben: ' übernehmen, indem Sie "*" eingeben:
' <Assembly: AssemblyVersion("1.0.*")> ' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.0.0.2")> <Assembly: AssemblyVersion("1.0.0.3")>
<Assembly: AssemblyFileVersion("1.0.0.2")> <Assembly: AssemblyFileVersion("1.0.0.3")>
Friend Module DesignTimeConstants Friend Module DesignTimeConstants
Public Const RibbonTypeSerializer As String = "Microsoft.VisualStudio.Tools.Office.Ribbon.Serialization.RibbonTypeCodeDomSerializer, Microsoft.VisualStudio.Tools.Office.Designer, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Public Const RibbonTypeSerializer As String = "Microsoft.VisualStudio.Tools.Office.Ribbon.Serialization.RibbonTypeCodeDomSerializer, Microsoft.VisualStudio.Tools.Office.Designer, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"

View File

@@ -22,7 +22,7 @@ Namespace My.Resources
'''<summary> '''<summary>
''' Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. ''' Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
'''</summary> '''</summary>
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0"), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _

View File

@@ -14,21 +14,21 @@ Option Explicit On
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0"), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0"), _
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Partial Friend NotInheritable Class MySettings Partial Friend NotInheritable Class MySettings
Inherits Global.System.Configuration.ApplicationSettingsBase Inherits Global.System.Configuration.ApplicationSettingsBase
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings) Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)
#Region "Funktion zum automatischen Speichern von My.Settings" #Region "Automatische My.Settings-Speicherfunktion"
#If _MyType = "WindowsForms" Then #If _MyType = "WindowsForms" Then
Private Shared addedHandler As Boolean Private Shared addedHandler As Boolean
Private Shared addedHandlerLockObject As New Object Private Shared addedHandlerLockObject As New Object
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) Private Shared Sub AutoSaveSettings(sender As Global.System.Object, e As Global.System.EventArgs)
If My.Application.SaveMySettingsOnExit Then If My.Application.SaveMySettingsOnExit Then
My.Settings.Save() My.Settings.Save()
End If End If

View File

@@ -1,91 +0,0 @@
Option Explicit On
Imports VERAG_PROG_ALLGEMEIN
Imports Microsoft.Office.Tools.Ribbon
Imports System.Windows.Forms
Imports Microsoft.Office.Interop
Imports VERAGAddIn.ThisAddIn
Public Class VERAGRibbon
Dim LOGIN_OK = False
Public Shared Event bla()
Private Sub CustomerRibbon_Load(ByVal sender As System.Object, ByVal e As Microsoft.Office.Tools.Ribbon.RibbonUIEventArgs) Handles MyBase.Load
End Sub
Private Function CreateRibbonDropDownItem() As RibbonDropDownItem
Return Me.Factory.CreateRibbonDropDownItem()
End Function
Private Function CreateRibbonMenu() As RibbonMenu
Return Me.Factory.CreateRibbonMenu()
End Function
Private Function CreateRibbonButton() As RibbonButton
Dim button As RibbonButton = Me.Factory.CreateRibbonButton()
' AddHandler (button.Click), AddressOf Button_Click
Return button
End Function
Private Sub Ribbon1_Load(ByVal sender As System.Object, ByVal e As RibbonUIEventArgs) Handles MyBase.Load
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = False
Dim ADMIN As New cADMIN
LOGIN_OK = ADMIN.checkLogin("MAIL_USER", "VERAG_MAIL_USER_2017", "VERAG")
' LOGIN_OK = ADMIN.checkLogin("MAIL_USER", "VERAG_MAIL_USER_2017", "ATILLA")
End Sub
Private Sub Button1_Click(sender As Object, e As RibbonControlEventArgs)
'MsgBox("HI")
' Dim ThisAddIn As New ThisAddIn
Dim s As String = ""
'Dim app = ThisAddIn.getapp()
' ThisAddIn.PrintAPageFromEmail()
RaiseEvent bla()
End Sub
Private Sub Button2_Click(sender As Object, e As RibbonControlEventArgs) Handles Button2.Click
If LOGIN_OK Then
' For Each ft As Form In My.Application.OpenForms
'If ft.GetType.ToString = "AVISO.frmEintragAviso" Then
'ft.BringToFront()
' Exit Sub
' End If
' Next
Dim EingangsDatum As Date = CDate("01.01.1990")
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
EingangsDatum = mailItem.ReceivedTime
End If
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
VERAG_PROG_ALLGEMEIN.cGlobal.Aktive_ID = 0
Dim mainForm As New AVISO.frmEintragAviso
If EingangsDatum > CDate("01.01.1990") Then
mainForm.EingangsDatum = EingangsDatum
End If
mainForm.TopMost = True
mainForm.StartFromOUTLOOK = True
mainForm.Show()
Else
MsgBox("Fehler beim Login!")
End If
End Sub
End Class

View File

@@ -21,7 +21,7 @@ Partial Public NotInheritable Class ThisAddIn
Friend WithEvents CustomTaskPanes As Microsoft.Office.Tools.CustomTaskPaneCollection Friend WithEvents CustomTaskPanes As Microsoft.Office.Tools.CustomTaskPaneCollection
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "12.0.0.0")> _ <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "15.0.0.0")> _
Friend WithEvents Application As Microsoft.Office.Interop.Outlook.Application Friend WithEvents Application As Microsoft.Office.Interop.Outlook.Application
''' '''
@@ -34,40 +34,40 @@ Partial Public NotInheritable Class ThisAddIn
''' '''
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "12.0.0.0"), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "15.0.0.0"), _
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Never)> _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Never)> _
Protected Overrides Sub Initialize() Protected Overrides Sub Initialize()
MyBase.Initialize() MyBase.Initialize
Me.Application = Me.GetHostItem(Of Microsoft.Office.Interop.Outlook.Application)(GetType(Microsoft.Office.Interop.Outlook.Application), "Application") Me.Application = Me.GetHostItem(Of Microsoft.Office.Interop.Outlook.Application)(GetType(Microsoft.Office.Interop.Outlook.Application), "Application")
Globals.ThisAddIn = Me Globals.ThisAddIn = Me
Global.System.Windows.Forms.Application.EnableVisualStyles() Global.System.Windows.Forms.Application.EnableVisualStyles
Me.InitializeCachedData() Me.InitializeCachedData
Me.InitializeControls() Me.InitializeControls
Me.InitializeComponents() Me.InitializeComponents
Me.InitializeData() Me.InitializeData
End Sub End Sub
''' '''
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "12.0.0.0"), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "15.0.0.0"), _
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Never)> _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Never)> _
Protected Overrides Sub FinishInitialization() Protected Overrides Sub FinishInitialization()
Me.OnStartup() Me.OnStartup
End Sub End Sub
''' '''
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "12.0.0.0"), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "15.0.0.0"), _
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Never)> _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Never)> _
Protected Overrides Sub InitializeDataBindings() Protected Overrides Sub InitializeDataBindings()
Me.BeginInitialization() Me.BeginInitialization
Me.BindToData() Me.BindToData
Me.EndInitialization() Me.EndInitialization
End Sub End Sub
''' '''
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "12.0.0.0"), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "15.0.0.0"), _
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Never)> _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Never)> _
Private Sub InitializeCachedData() Private Sub InitializeCachedData()
If (Me.DataHost Is Nothing) Then If (Me.DataHost Is Nothing) Then
@@ -80,14 +80,14 @@ Partial Public NotInheritable Class ThisAddIn
''' '''
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "12.0.0.0"), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "15.0.0.0"), _
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Never)> _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Never)> _
Private Sub InitializeData() Private Sub InitializeData()
End Sub End Sub
''' '''
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "12.0.0.0"), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "15.0.0.0"), _
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Never)> _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Never)> _
Private Sub BindToData() Private Sub BindToData()
End Sub End Sub
@@ -115,25 +115,25 @@ Partial Public NotInheritable Class ThisAddIn
''' '''
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "12.0.0.0"), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "15.0.0.0"), _
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Never)> _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Never)> _
Private Sub BeginInitialization() Private Sub BeginInitialization()
Me.BeginInit() Me.BeginInit
Me.CustomTaskPanes.BeginInit() Me.CustomTaskPanes.BeginInit
End Sub End Sub
''' '''
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "12.0.0.0"), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "15.0.0.0"), _
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Never)> _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Never)> _
Private Sub EndInitialization() Private Sub EndInitialization()
Me.CustomTaskPanes.EndInit() Me.CustomTaskPanes.EndInit
Me.EndInit() Me.EndInit
End Sub End Sub
''' '''
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "12.0.0.0"), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "15.0.0.0"), _
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Never)> _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Never)> _
Private Sub InitializeControls() Private Sub InitializeControls()
Me.CustomTaskPanes = Globals.Factory.CreateCustomTaskPaneCollection(Nothing, Nothing, "CustomTaskPanes", "CustomTaskPanes", Me) Me.CustomTaskPanes = Globals.Factory.CreateCustomTaskPaneCollection(Nothing, Nothing, "CustomTaskPanes", "CustomTaskPanes", Me)
@@ -141,7 +141,7 @@ Partial Public NotInheritable Class ThisAddIn
''' '''
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "12.0.0.0"), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "15.0.0.0"), _
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Never)> _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Never)> _
Private Sub InitializeComponents() Private Sub InitializeComponents()
End Sub End Sub
@@ -155,22 +155,22 @@ Partial Public NotInheritable Class ThisAddIn
''' '''
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "12.0.0.0"), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "15.0.0.0"), _
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Never)> _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Never)> _
Protected Overrides Sub OnShutdown() Protected Overrides Sub OnShutdown()
Me.CustomTaskPanes.Dispose() Me.CustomTaskPanes.Dispose
MyBase.OnShutdown() MyBase.OnShutdown
End Sub End Sub
End Class End Class
''' '''
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "12.0.0.0")> _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "15.0.0.0")> _
Partial Friend NotInheritable Class Globals Partial Friend NotInheritable Class Globals
''' '''
Private Sub New() Private Sub New()
MyBase.New() MyBase.New
End Sub End Sub
Private Shared _ThisAddIn As ThisAddIn Private Shared _ThisAddIn As ThisAddIn
@@ -185,7 +185,7 @@ Partial Friend NotInheritable Class Globals
Get Get
Return _ThisAddIn Return _ThisAddIn
End Get End Get
Set(value As ThisAddIn) Set
If (_ThisAddIn Is Nothing) Then If (_ThisAddIn Is Nothing) Then
_ThisAddIn = value _ThisAddIn = value
Else Else
@@ -198,7 +198,7 @@ Partial Friend NotInheritable Class Globals
Get Get
Return _factory Return _factory
End Get End Get
Set(value As Global.Microsoft.Office.Tools.Outlook.Factory) Set
If (_factory Is Nothing) Then If (_factory Is Nothing) Then
_factory = value _factory = value
Else Else
@@ -228,7 +228,7 @@ End Class
''' '''
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "12.0.0.0")> _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "15.0.0.0")> _
Partial Friend NotInheritable Class ThisRibbonCollection Partial Friend NotInheritable Class ThisRibbonCollection
Inherits Microsoft.Office.Tools.Ribbon.RibbonCollectionBase Inherits Microsoft.Office.Tools.Ribbon.RibbonCollectionBase
@@ -237,13 +237,13 @@ Partial Friend NotInheritable Class ThisRibbonCollection
MyBase.New(factory) MyBase.New(factory)
End Sub End Sub
Default Friend Overloads ReadOnly Property Item(ByVal inspector As Microsoft.Office.Interop.Outlook.Inspector) As ThisRibbonCollection Friend Overloads Default ReadOnly Property Item(ByVal inspector As Microsoft.Office.Interop.Outlook.Inspector) As ThisRibbonCollection
Get Get
Return Me.GetRibbonContextCollection(Of ThisRibbonCollection)(inspector) Return Me.GetRibbonContextCollection(Of ThisRibbonCollection)(inspector)
End Get End Get
End Property End Property
Default Friend Overloads ReadOnly Property Item(ByVal explorer As Microsoft.Office.Interop.Outlook.Explorer) As ThisRibbonCollection Friend Overloads Default ReadOnly Property Item(ByVal explorer As Microsoft.Office.Interop.Outlook.Explorer) As ThisRibbonCollection
Get Get
Return Me.GetRibbonContextCollection(Of ThisRibbonCollection)(explorer) Return Me.GetRibbonContextCollection(Of ThisRibbonCollection)(explorer)
End Get End Get
@@ -260,13 +260,13 @@ Partial Friend NotInheritable Class ThisFormRegionCollection
MyBase.New(list) MyBase.New(list)
End Sub End Sub
Default Friend Overloads ReadOnly Property Item(ByVal explorer As Microsoft.Office.Interop.Outlook.Explorer) As WindowFormRegionCollection Friend Overloads Default ReadOnly Property Item(ByVal explorer As Microsoft.Office.Interop.Outlook.Explorer) As WindowFormRegionCollection
Get Get
Return CType(Globals.ThisAddIn.GetFormRegions(explorer, GetType(WindowFormRegionCollection)),WindowFormRegionCollection) Return CType(Globals.ThisAddIn.GetFormRegions(explorer, GetType(WindowFormRegionCollection)),WindowFormRegionCollection)
End Get End Get
End Property End Property
Default Friend Overloads ReadOnly Property Item(ByVal inspector As Microsoft.Office.Interop.Outlook.Inspector) As WindowFormRegionCollection Friend Overloads Default ReadOnly Property Item(ByVal inspector As Microsoft.Office.Interop.Outlook.Inspector) As WindowFormRegionCollection
Get Get
Return CType(Globals.ThisAddIn.GetFormRegions(inspector, GetType(WindowFormRegionCollection)),WindowFormRegionCollection) Return CType(Globals.ThisAddIn.GetFormRegions(inspector, GetType(WindowFormRegionCollection)),WindowFormRegionCollection)
End Get End Get

View File

@@ -26,7 +26,7 @@
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<RootNamespace>VERAGAddIn</RootNamespace> <RootNamespace>VERAGAddIn</RootNamespace>
<AssemblyName>VERAGAddIn</AssemblyName> <AssemblyName>VERAGAddIn</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<DefineConstants>VSTO40</DefineConstants> <DefineConstants>VSTO40</DefineConstants>
<StartupObject> <StartupObject>
</StartupObject> </StartupObject>
@@ -36,8 +36,8 @@
<PublishUrl>D:\Andreas\Programmierung\VB\OutlookAddIN\BEREITSTELLUNG\</PublishUrl> <PublishUrl>D:\Andreas\Programmierung\VB\OutlookAddIN\BEREITSTELLUNG\</PublishUrl>
<InstallUrl /> <InstallUrl />
<TargetCulture>de</TargetCulture> <TargetCulture>de</TargetCulture>
<ApplicationVersion>1.0.0.27</ApplicationVersion> <ApplicationVersion>1.0.0.43</ApplicationVersion>
<AutoIncrementApplicationRevision>true</AutoIncrementApplicationRevision> <AutoIncrementApplicationRevision>false</AutoIncrementApplicationRevision>
<UpdateEnabled>true</UpdateEnabled> <UpdateEnabled>true</UpdateEnabled>
<UpdateInterval>7</UpdateInterval> <UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>days</UpdateIntervalUnits> <UpdateIntervalUnits>days</UpdateIntervalUnits>
@@ -54,6 +54,11 @@
<ProductName>Microsoft .NET Framework 4.5 %28x86 and x64%29</ProductName> <ProductName>Microsoft .NET Framework 4.5 %28x86 and x64%29</ProductName>
<Install>true</Install> <Install>true</Install>
</BootstrapperPackage> </BootstrapperPackage>
<BootstrapperPackage Include=".NETFramework,Version=v4.6.1">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.6.1 %28x86 und x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5"> <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible> <Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName> <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
@@ -206,17 +211,17 @@
--> -->
<ItemGroup> <ItemGroup>
<AppDesigner Include="My Project\" /> <AppDesigner Include="My Project\" />
<Compile Include="Ribbon1.Designer.vb"> <Compile Include="rbnVERAG.Designer.vb">
<DependentUpon>Ribbon1.vb</DependentUpon> <DependentUpon>rbnVERAG.vb</DependentUpon>
</Compile> </Compile>
<Compile Include="Ribbon1.vb"> <Compile Include="rbnVERAG.vb">
<SubType>Component</SubType> <SubType>Component</SubType>
</Compile> </Compile>
<Compile Include="ThisAddIn.vb"> <Compile Include="ThisAddIn.vb">
<SubType>Code</SubType> <SubType>Code</SubType>
</Compile> </Compile>
<EmbeddedResource Include="Ribbon1.resx"> <EmbeddedResource Include="rbnVERAG.resx">
<DependentUpon>Ribbon1.vb</DependentUpon> <DependentUpon>rbnVERAG.vb</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<None Include="app.config" /> <None Include="app.config" />
<None Include="ThisAddIn.Designer.xml"> <None Include="ThisAddIn.Designer.xml">

View File

@@ -10,6 +10,10 @@
<assemblyIdentity name="WindowsBase" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <assemblyIdentity name="WindowsBase" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" /> <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
</dependentAssembly>
</assemblyBinding> </assemblyBinding>
</runtime> </runtime>
</configuration> <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" /></startup></configuration>

View File

@@ -46,6 +46,7 @@
Me.Button2 = Me.Factory.CreateRibbonButton Me.Button2 = Me.Factory.CreateRibbonButton
Me.Tab1.SuspendLayout() Me.Tab1.SuspendLayout()
Me.VERAG.SuspendLayout() Me.VERAG.SuspendLayout()
Me.SuspendLayout()
' '
'Tab1 'Tab1
' '
@@ -77,6 +78,7 @@
Me.Tab1.PerformLayout() Me.Tab1.PerformLayout()
Me.VERAG.ResumeLayout(False) Me.VERAG.ResumeLayout(False)
Me.VERAG.PerformLayout() Me.VERAG.PerformLayout()
Me.ResumeLayout(False)
End Sub End Sub

181
VERAGAddIn/rbnVERAG.vb Normal file
View File

@@ -0,0 +1,181 @@
Option Explicit On
Imports VERAG_PROG_ALLGEMEIN
Imports Microsoft.Office.Tools.Ribbon
Imports System.Windows.Forms
Imports Microsoft.Office.Interop
Imports VERAGAddIn.ThisAddIn
Imports System.Runtime.InteropServices
Public Class VERAGRibbon
Dim LOGIN_OK = False
Public Shared Event bla()
Private Sub CustomerRibbon_Load(ByVal sender As System.Object, ByVal e As Microsoft.Office.Tools.Ribbon.RibbonUIEventArgs) Handles MyBase.Load
End Sub
Private Function CreateRibbonDropDownItem() As RibbonDropDownItem
Return Me.Factory.CreateRibbonDropDownItem()
End Function
Private Function CreateRibbonMenu() As RibbonMenu
Return Me.Factory.CreateRibbonMenu()
End Function
Private Function CreateRibbonButton() As RibbonButton
Dim button As RibbonButton = Me.Factory.CreateRibbonButton()
' AddHandler (button.Click), AddressOf Button_Click
Return button
End Function
Private Sub Ribbon1_Load(ByVal sender As System.Object, ByVal e As RibbonUIEventArgs) Handles MyBase.Load
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = False
initFirmaUser()
End Sub
Sub initFirmaUser()
Dim ADMIN As New cADMIN
Try
Dim WI = System.Security.Principal.WindowsIdentity.GetCurrent().Name
If WI.Contains("\") Then
Dim Split() = WI.Split("\")
If Split(0).Contains("VERAG-NCTS") Then VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA = "ATILLA"
If Split(0).Contains("VERAG") Then VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA = "VERAG"
If Split(0).Contains("IMEX") Then VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA = "IMEX"
Dim UsernameTMP = ADMIN.getUstName_ByAD(Split(0), Split(1))
If UsernameTMP <> "" Then
LOGIN_OK = ADMIN.checkLogin(UsernameTMP, ADMIN.getPwdFromUsrname(UsernameTMP, VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA), VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA)
End If
End If
Catch ex As Exception
' MsgBox(ex.Message & ex.StackTrace)
End Try
If Not LOGIN_OK Then
LOGIN_OK = ADMIN.checkLogin("MAIL_USER", "VERAG_MAIL_USER_2017", "VERAG")
End If
End Sub
Private Sub Button1_Click(sender As Object, e As RibbonControlEventArgs)
'MsgBox("HI")
' Dim ThisAddIn As New ThisAddIn
Dim s As String = ""
'Dim app = ThisAddIn.getapp()
' ThisAddIn.PrintAPageFromEmail()
RaiseEvent bla()
End Sub
Private Sub Button2_Click(sender As Object, e As RibbonControlEventArgs) Handles Button2.Click
If LOGIN_OK Then
' For Each ft As Form In My.Application.OpenForms
'If ft.GetType.ToString = "AVISO.frmEintragAviso" Then
'ft.BringToFront()
' Exit Sub
' End If
' Next
Dim ATTACHMENTS_LIST As New List(Of String)
Dim KundenNr = -1
Dim EingangsDatum As Date = CDate("01.01.1990")
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
EingangsDatum = mailItem.ReceivedTime
Dim senderMail = ""
If mailItem.SenderEmailType = "EX" Then
senderMail = (mailItem.Sender.GetExchangeUser.PrimarySmtpAddress)
Else
senderMail = (mailItem.SenderEmailAddress)
End If
KundenNr = VERAG_PROG_ALLGEMEIN.cKundenKontakte.getKdNrFromMailAdress(senderMail, False) ' false, wenn mehrere Niederlassungen von Frimen im KdStamm vorhanden... falsche KdNr...
End If
saveAttachment(mailItem, ATTACHMENTS_LIST)
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
VERAG_PROG_ALLGEMEIN.cGlobal.Aktive_ID = 0
Dim mainForm As New AVISO.frmEintragAviso
If KundenNr > 0 Then
AddHandler mainForm.Shown, Sub()
mainForm.kdAvisierer.KdNr = KundenNr
End Sub
End If
If EingangsDatum > CDate("01.01.1990") Then
mainForm.EingangsDatum = EingangsDatum
End If
mainForm.TopMost = True
mainForm.StartFromOUTLOOK = True
mainForm.ShowDialog()
Try
If VERAG_PROG_ALLGEMEIN.cGlobal.Aktive_ID > 0 Then
For Each ATT In ATTACHMENTS_LIST
Dim fi As New IO.FileInfo(ATT)
Dim typ = ""
If AVISO.frmSendungAnhangImport.getFileTypeValid(typ, fi.Extension) Then
AVISO.frmSendungAnhangImport.saveToDS(VERAG_PROG_ALLGEMEIN.cGlobal.Aktive_ID, fi.Name, ATT, "", typ)
End If
Next
End If
Catch ex As Exception
MsgBox(ex.Message & ex.StackTrace)
End Try
Else
MsgBox("Fehler beim Login!")
End If
End Sub
Private Sub saveAttachment(mail As Outlook.MailItem, ByRef ATTACHMENTS_LIST As List(Of String))
Dim attachments As Outlook.Attachments = Nothing
Try
attachments = mail.Attachments
For Each attachment As Outlook.Attachment In mail.Attachments
'Next
'For i As Integer = 1 To attachments.Count
' Dim attachment As Outlook.Attachment = attachments.Item(i)
' MsgBox(attachment.FileName)
Dim specialFolder = "OutlookAttach\Outlook_" & Now.ToString("ddMMyy_HHmmss")
While IO.Directory.Exists(specialFolder)
specialFolder = "OutlookAttach\Outlook_" & Now.ToString("ddMMyy_HHmmss")
End While
' Dim io As New IO.FileInfo(attachment.PathName)
Dim TMP_PATH As String = VERAG_PROG_ALLGEMEIN.DATENVERVER_OPTIONS.getTMPPath(attachment.FileName, " io.Extension", False, False, specialFolder)
attachment.SaveAsFile(TMP_PATH)
ATTACHMENTS_LIST.Add(TMP_PATH)
Marshal.ReleaseComObject(attachment)
Next
Catch ex As Exception
MsgBox(ex.Message, ex.StackTrace)
Finally
If attachments IsNot Nothing Then
Marshal.ReleaseComObject(attachments)
End If
If mail IsNot Nothing Then
Marshal.ReleaseComObject(mail)
End If
'If currInspector IsNot Nothing Then
' Marshal.ReleaseComObject(currInspector)
'End If
End Try
End Sub
End Class