Create Add-in for Outlook 2007

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Sep 2007
Posts: 8
Reputation: Sunny28525 is an unknown quantity at this point 
Solved Threads: 0
Sunny28525 Sunny28525 is offline Offline
Newbie Poster

Create Add-in for Outlook 2007

 
0
  #1
Oct 13th, 2007
i have created add-in for Outlook 2007 . but when i run outlook the commandbar button which should be appear on standard bar , does not appear.
i think there is a problem in register of Add-in.
the code are as follows :
  1. imports Extensibility
  2. Imports System.Runtime.InteropServices
  3. Imports Microsoft.Office.Core
  4. Imports Microsoft.Office.Interop
  5.  
  6.  
  7.  
  8. #Region " Read me for Add-in installation and setup information. "
  9. ' When run, the Add-in wizard prepared the registry for the Add-in.
  10. ' At a later time, if the Add-in becomes unavailable for reasons such as:
  11. ' 1) You moved this project to a computer other than which is was originally created on.
  12. ' 2) You chose 'Yes' when presented with a message asking if you wish to remove the Add-in.
  13. ' 3) Registry corruption.
  14. ' you will need to re-register the Add-in by building the $SAFEOBJNAME$Setup project,
  15. ' right click the project in the Solution Explorer, then choose install.
  16. #End Region
  17.  
  18. <GuidAttribute("F5F9500E-08F4-4391-B2F7-29FDE0BB4C23"), ProgIdAttribute("ISOLAddin.Connect")> _
  19. Public Class Connect
  20.  
  21. Implements Extensibility.IDTExtensibility2
  22.  
  23.  
  24. Dim applicationObject As Object
  25. Dim addInInstance As Object
  26. Dim WithEvents MyButton As Microsoft.Office.Core.CommandBarButton
  27. Dim OApp As Outlook.Application
  28.  
  29.  
  30.  
  31.  
  32. Public Sub OnBeginShutdown(ByRef custom As System.Array) Implements Extensibility.IDTExtensibility2.OnBeginShutdown
  33. MsgBox("Our custom Add-in is unloading.")
  34. MyButton.Delete()
  35. MyButton = Nothing
  36. End Sub
  37.  
  38. Public Sub OnAddInsUpdate(ByRef custom As System.Array) Implements Extensibility.IDTExtensibility2.OnAddInsUpdate
  39. End Sub
  40.  
  41. Public Sub OnStartupComplete(ByRef custom As System.Array) Implements Extensibility.IDTExtensibility2.OnStartupComplete
  42.  
  43.  
  44.  
  45. Dim ComBar As CommandBars
  46. Dim StdBar As CommandBar
  47. Dim OAppExpl As Outlook.Explorer
  48. OAppExpl = CType(OApp.ActiveExplorer, Outlook.Explorer)
  49.  
  50. ComBar = OAppExpl.CommandBars
  51. If ComBar Is Nothing Then
  52. ComBar = OApp.ActiveExplorer.CommandBars
  53. End If
  54.  
  55. ComBar = applicationObject.CommandBars()
  56. StdBar = ComBar.Item("Standard")
  57. If StdBar Is Nothing Then
  58. StdBar = ComBar.Item("Database")
  59. End If
  60.  
  61. MyButton = CType(StdBar.FindControl(Tag:="My Custom Button"), CommandBarButton)
  62.  
  63. If MyButton Is Nothing Then
  64. MyButton = CType(StdBar.Controls.Add(Type:=MsoControlType.msoControlButton, Temporary:=False), CommandBarButton)
  65.  
  66. With MyButton
  67. .Caption = "My Custom Button"
  68. .Style = MsoButtonStyle.msoButtonCaption
  69. .Tag = "My Custom Button"
  70. .OnAction = "!<ISOLAddin.connect>"
  71. .Visible = True
  72. End With
  73. End If
  74. MsgBox("Started in " & OApp.Name & ".")
  75.  
  76. ComBar = Nothing
  77. StdBar = Nothing
  78.  
  79.  
  80. End Sub
  81.  
  82. Public Sub OnDisconnection(ByVal RemoveMode As Extensibility.ext_DisconnectMode, ByRef custom As System.Array) Implements Extensibility.IDTExtensibility2.OnDisconnection
  83. If RemoveMode <> ext_DisconnectMode.ext_dm_HostShutdown Then
  84. Call OnBeginShutdown(custom)
  85. End If
  86. OApp = Nothing
  87.  
  88. End Sub
  89.  
  90. 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
  91. MsgBox("On Connection In MyAddin")
  92. applicationObject = application
  93. addInInstance = addInInst
  94.  
  95. If connectMode <> ext_ConnectMode.ext_cm_Startup Then
  96. Call OnStartupComplete(custom)
  97. End If
  98.  
  99. End Sub
  100.  
  101. Private Sub MyButton_Click(ByVal Ctrl As Microsoft.Office.Core.CommandBarButton, ByRef CancelDefault As Boolean) Handles MyButton.Click
  102. MsgBox("Our CommandBar button was pressed!")
  103. End Sub
  104. End Class
please tell me , what is the problem in this ?

Thanks !
Last edited by Ancient Dragon; Feb 5th, 2009 at 6:47 pm. Reason: add code tags
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 1
Reputation: luka_ghost is an unknown quantity at this point 
Solved Threads: 0
luka_ghost luka_ghost is offline Offline
Newbie Poster

Re: Create Add-in for Outlook 2007

 
0
  #2
Apr 19th, 2008
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 12
Reputation: ronjustincase is an unknown quantity at this point 
Solved Threads: 2
ronjustincase ronjustincase is offline Offline
Newbie Poster

Re: Create Add-in for Outlook 2007

 
0
  #3
Feb 5th, 2009
http://www.outlooktrackit.com <--- I love this toolbar, Outlook Track-It. I want to create something just like this that reminds the user to followup to emails. It's so simple...and perfect. Any suggestions???
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: Create Add-in for Outlook 2007

 
0
  #4
Feb 5th, 2009
Yeah, let's not post to threads that are nearing a year old.....
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC