Files
VERAGAddin/VERAGAddIn/Ribbon1.vb
2019-08-09 09:42:50 +02:00

92 lines
3.0 KiB
VB.net

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