Jump to content

gsaluja

Member
  • Posts

    2
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    New Zealand

About gsaluja

gsaluja's Achievements

0

Reputation

  1. See the question is Previously I had developed outlook com add-in using visual studio 2003..it worked fine. Now I am trying to implement a very basic com add-in that just trys to show a messagebox in the start event, using vsto 2005, the problem that I am facing is. The registry gets update when I create a com add-in, but outlook does not load the com. I can even see the com under com add-in dialog box but, again cannot select the com through the dialog box either. Outlook doesnt load the com even when I run it in the debug mode through vs 2005. I dont know whats happening,as I dont get any errors what so ever. one more thing, when creating an outlook add-in in vs 2005, the registry settings is updated under HKEY_CURRENT_USER, but outlook seems to be reponding to registry setting under HKEY_LOCAL_MACHINE, which was the default for vs 2003 please help, its Urgent Thank you
  2. Hi to All, I have been desperately trying to find a solution to this problem. Now the problem is, I am trying to build a simple outlook com add in vb.net. Every thing works fine but the moment I declare a mailitem object in goButton event, outlook stays in the memory. I have tried every thing to release the mail item object. but no matter what i do..outlook stays in the memory the code i have written so far is '''trying to release the objects Public Sub OnBeginShutdown(ByRef custom As System.Array) Implements Extensibility.IDTExtensibility2.OnBeginShutdown On Error Resume Next ' Notify the user you are shutting down, and delete the button. goButton.Delete() goButton = Nothing GC.Collect() GC.WaitForPendingFinalizers() MsgBox("Our custom Add-in is unloading.") 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 = CType(application, Microsoft.Office.Interop.Outlook.Application) addInInstance = addInInst goInspectors = applicationObject.Inspectors MsgBox("Our custom Add-in is loading.") m_olExplorer = CType(applicationObject.ActiveExplorer, _ Microsoft.Office.Interop.Outlook.ExplorerClass) m_objInsp = CType(applicationObject.ActiveInspector, _ Microsoft.Office.Interop.Outlook.InspectorClass) End Sub ///adds a new button to the send email inspector Private Sub goInspectors_NewInspector(ByVal Inspector As Microsoft.Office.Interop.Outlook.Inspector) Handles goInspectors.NewInspector ' Resume next since the FindControl call will generate an ' error if the button can not be found. We don't want to ' end, but add the button to the controlbar. On Error Resume Next Dim oSend As CommandBarButton Dim oSendBar As CommandBar oSendBar = Inspector.CommandBars("Standard") oSend = CType(oSendBar.FindControl(Id:=oSendBar.Controls("Send Message").Id), CommandBarButton) Dim oBar As CommandBar oBar = Inspector.CommandBars("Standard") goButton = CType(oBar.Controls.Item("Send & Track"), CommandBarButton) goButton = CType(oBar.FindControl(Id:=oBar.Controls("Send & Track").Id), CommandBarButton) If goButton Is Nothing Then goButton = CType(oBar.Controls.Add(1), CommandBarButton) With goButton .Caption = "Send & Track" .Style = MsoButtonStyle.msoButtonIconAndCaption .Tag = "Send & Track" .FaceId = oSend.FaceId End With End If If CType(Inspector.CurrentItem, OlObjectClass) = OlObjectClass.olMail Then goButton.Visible = True Else goButton.Visible = False End If oSend.Delete() End Sub ''''here where the problem is i have declared a" objMailItem = CType(applicationObject.ActiveInspector.CurrentItem, MailItem)" ...if i omit this outlook closes fine other wise it stay in the momery. i have tried every thing to release the object but no matter what i do...nothing works Private Sub goButton_Click(ByVal Ctrl As Microsoft.Office.Core.CommandBarButton, ByRef CancelDefault As Boolean) Handles goButton.Click Try MsgBox("Our CommandBar button was pressed!") objMailItem = CType(applicationObject.ActiveInspector.CurrentItem, MailItem) objMailItem = nothing Catch ex As System.Exception MsgBox("Error") End Try End Sub i have even tried using the explorer close event to delete all object but still with no luck. Please do help me as this project needs to be completed in next two days and I am just stuck here. Please any information would be appreciated
×
×
  • Create New...