Hello,
I am new in the VB .NET World and i wanted to learn how to make an Add-in for Outlook.
It is just a bit hard for me because i have my VB Code which works, but i don't know how i can create an Button which i can press to execute my sub. I found already something to create Ribbons but i think then i am mixing VB and C#.
Maybe someone can give me some tips?
This is my VB Code which should get executed:
Best Regards,
sQuattu
I am new in the VB .NET World and i wanted to learn how to make an Add-in for Outlook.
It is just a bit hard for me because i have my VB Code which works, but i don't know how i can create an Button which i can press to execute my sub. I found already something to create Ribbons but i think then i am mixing VB and C#.
Maybe someone can give me some tips?
This is my VB Code which should get executed:
Code:
Public Sub SendPrive()
Dim Item As Outlook.MailItem
Dim oInspector As Inspector
Set oInspector = Application.ActiveInspector
If oInspector Is Nothing Then
Set Item = Application.ActiveExplorer.Selection.Item(1)
Item.Display 'Force the po-up
Set oInspector = Application.ActiveInspector 'Reassign oInpsector and Item again
Set Item = oInspector.CurrentItem
Else
Set Item = oInspector.CurrentItem
End If
strSubject = Item.Subject
If StrComp(Left(strSubject, 6), "#PRIVE") <> 0 Then
strSubject = "#PRIVE " + strSubject
Else
strSubject = Right(strSubject, Len(strSubject) - 7)
End If
' Set the message subject
Item.Subject = strSubject
Item.Send
Set Item = Nothing
Set oInspector = Nothing
End Sub
sQuattu