A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

program new toolbar in outlook with VB.NET 2003



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old March 1st 06, 07:20 AM posted to microsoft.public.outlook.program_addins
Oskar Vaia
external usenet poster
 
Posts: 29
Default program new toolbar in outlook with VB.NET 2003

hello,

i try to develop an addin for outlook 2003 with VB.NET 2003.
here is the code for the "connect"-class.

---
Public Class Connect

Implements Extensibility.IDTExtensibility2

Dim applicationObject as Object
dim addInInstance as object

Dim WithEvents oApplication As
Microsoft.Office.Interop.Outlook.Application
Dim WithEvents oCreateAccountBHandler As
Microsoft.Office.Core.CommandBarButton
Dim oCommandBar As CommandBar

Public Sub OnBeginShutdown(ByRef custom As System.Array) Implements
Extensibility.IDTExtensibility2.OnBeginShutdown
End Sub

Public Sub OnAddInsUpdate(ByRef custom As System.Array) Implements
Extensibility.IDTExtensibility2.OnAddInsUpdate
End Sub

Public Sub OnStartupComplete(ByRef custom As System.Array) Implements
Extensibility.IDTExtensibility2.OnStartupComplete
MsgBox("TEST")

Dim oCommandBars As Microsoft.Office.Core.CommandBars
Dim oCommandBars2 As Microsoft.Office.Core.CommandBar
Dim oControls As Microsoft.Office.Core.CommandBarControls
Dim oControl As Microsoft.Office.Core.CommandBarButton

oCommandBars = oApplication.ActiveExplorer.CommandBars
oCommandBar = oCommandBars.Add("Account ToolBar", Temporary:=False)
oControl =
oCommandBar.Controls.Add(Type:=MsoControlType.msoC ontrolButton, ID:=1,
Temporary:=False)
oControl.Caption = "CNA"
oControl.FaceId = 609
oControl.Style = MsoButtonStyle.msoButtonIconAndCaption
oCreateAccountBHandler = oControl
oCommandBar.Visible = True
oCommandBar.Position = MsoBarPosition.msoBarLeft

End Sub

Public Sub OnDisconnection(ByVal RemoveMode As
Extensibility.ext_DisconnectMode, ByRef custom As System.Array) Implements
Extensibility.IDTExtensibility2.OnDisconnection
End Sub

Public Sub OnConnection(ByVal application As Object, ByVal connectMode
As Extensibility.ext_ConnectMode, ByVal addInInst As Object, ByRef custom As
System.Array) Implements Extensibility.IDTExtensibility2.OnConnection
applicationObject = application
addInInstance = addInInst

End Sub

End Class
---

My Problem:
the new toolbar "Account ToolBar" doesn't appear in outlook! can someone
please help me to resolve this?

thanks

Oskar


Ads
  #2  
Old March 1st 06, 07:47 PM posted to microsoft.public.outlook.program_addins
Rog
external usenet poster
 
Posts: 62
Default program new toolbar in outlook with VB.NET 2003

I see in your code you have a MsgBox. does this get invoked. This would
help to ensure that you add-in is in fact being loaded properly.

Oskar Vaia wrote:
hello,

i try to develop an addin for outlook 2003 with VB.NET 2003.
here is the code for the "connect"-class.

---
Public Class Connect

Implements Extensibility.IDTExtensibility2

Dim applicationObject as Object
dim addInInstance as object

Dim WithEvents oApplication As
Microsoft.Office.Interop.Outlook.Application
Dim WithEvents oCreateAccountBHandler As
Microsoft.Office.Core.CommandBarButton
Dim oCommandBar As CommandBar

Public Sub OnBeginShutdown(ByRef custom As System.Array) Implements
Extensibility.IDTExtensibility2.OnBeginShutdown
End Sub

Public Sub OnAddInsUpdate(ByRef custom As System.Array) Implements
Extensibility.IDTExtensibility2.OnAddInsUpdate
End Sub

Public Sub OnStartupComplete(ByRef custom As System.Array) Implements
Extensibility.IDTExtensibility2.OnStartupComplete
MsgBox("TEST")

Dim oCommandBars As Microsoft.Office.Core.CommandBars
Dim oCommandBars2 As Microsoft.Office.Core.CommandBar
Dim oControls As Microsoft.Office.Core.CommandBarControls
Dim oControl As Microsoft.Office.Core.CommandBarButton

oCommandBars = oApplication.ActiveExplorer.CommandBars
oCommandBar = oCommandBars.Add("Account ToolBar", Temporary:=False)
oControl =
oCommandBar.Controls.Add(Type:=MsoControlType.msoC ontrolButton, ID:=1,
Temporary:=False)
oControl.Caption = "CNA"
oControl.FaceId = 609
oControl.Style = MsoButtonStyle.msoButtonIconAndCaption
oCreateAccountBHandler = oControl
oCommandBar.Visible = True
oCommandBar.Position = MsoBarPosition.msoBarLeft

End Sub

Public Sub OnDisconnection(ByVal RemoveMode As
Extensibility.ext_DisconnectMode, ByRef custom As System.Array) Implements
Extensibility.IDTExtensibility2.OnDisconnection
End Sub

Public Sub OnConnection(ByVal application As Object, ByVal connectMode
As Extensibility.ext_ConnectMode, ByVal addInInst As Object, ByRef custom As
System.Array) Implements Extensibility.IDTExtensibility2.OnConnection
applicationObject = application
addInInstance = addInInst

End Sub

End Class
---

My Problem:
the new toolbar "Account ToolBar" doesn't appear in outlook! can someone
please help me to resolve this?

thanks

Oskar


  #3  
Old March 20th 06, 03:34 PM posted to microsoft.public.outlook.program_addins
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default program new toolbar in outlook with VB.NET 2003

You might want to head over to http://www.microeye.com and getthe Items Command Bar sample forom their Resources section. It is the primer on Explorer CommandBars.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Oskar Vaia" wrote in message ...
hello,

i try to develop an addin for outlook 2003 with VB.NET 2003.
here is the code for the "connect"-class.

---
Public Class Connect

Implements Extensibility.IDTExtensibility2

Dim applicationObject as Object
dim addInInstance as object

Dim WithEvents oApplication As
Microsoft.Office.Interop.Outlook.Application
Dim WithEvents oCreateAccountBHandler As
Microsoft.Office.Core.CommandBarButton
Dim oCommandBar As CommandBar

Public Sub OnBeginShutdown(ByRef custom As System.Array) Implements
Extensibility.IDTExtensibility2.OnBeginShutdown
End Sub

Public Sub OnAddInsUpdate(ByRef custom As System.Array) Implements
Extensibility.IDTExtensibility2.OnAddInsUpdate
End Sub

Public Sub OnStartupComplete(ByRef custom As System.Array) Implements
Extensibility.IDTExtensibility2.OnStartupComplete
MsgBox("TEST")

Dim oCommandBars As Microsoft.Office.Core.CommandBars
Dim oCommandBars2 As Microsoft.Office.Core.CommandBar
Dim oControls As Microsoft.Office.Core.CommandBarControls
Dim oControl As Microsoft.Office.Core.CommandBarButton

oCommandBars = oApplication.ActiveExplorer.CommandBars
oCommandBar = oCommandBars.Add("Account ToolBar", Temporary:=False)
oControl =
oCommandBar.Controls.Add(Type:=MsoControlType.msoC ontrolButton, ID:=1,
Temporary:=False)
oControl.Caption = "CNA"
oControl.FaceId = 609
oControl.Style = MsoButtonStyle.msoButtonIconAndCaption
oCreateAccountBHandler = oControl
oCommandBar.Visible = True
oCommandBar.Position = MsoBarPosition.msoBarLeft

End Sub

Public Sub OnDisconnection(ByVal RemoveMode As
Extensibility.ext_DisconnectMode, ByRef custom As System.Array) Implements
Extensibility.IDTExtensibility2.OnDisconnection
End Sub

Public Sub OnConnection(ByVal application As Object, ByVal connectMode
As Extensibility.ext_ConnectMode, ByVal addInInst As Object, ByRef custom As
System.Array) Implements Extensibility.IDTExtensibility2.OnConnection
applicationObject = application
addInInstance = addInInst

End Sub

End Class
---

My Problem:
the new toolbar "Account ToolBar" doesn't appear in outlook! can someone
please help me to resolve this?

thanks

Oskar


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Program to synchronize Outlook 2003 Eckhardt Newger Outlook - General Queries 5 February 20th 06 10:22 PM
How do I set up my bellsouth.net account in Outlook 2003 aramispxxvi Outlook - Installation 1 February 20th 06 06:56 PM
my Outlook 2003 program crashes everytime I delete an email? Why A disenchanted Outlook 2003 user Outlook - General Queries 1 February 4th 06 11:58 PM
Why does Outlook 2003 program crashes when user attempts to create TizTIz Outlook - Installation 1 January 31st 06 10:23 AM
best way to support outlook 2000, 2002, and 2003 and .NET Josh Einstein Add-ins for Outlook 1 January 8th 06 07:30 AM


All times are GMT +1. The time now is 09:03 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2024 Outlook Banter.
The comments are property of their posters.