i am trying to Execute some command Bar Button but doesn't work

G

Guest

hi there,

i am trying to Execute some command Bar Button i can change if there
Visible, Enabled and Caption of them but i can't Execute them and i don;t
know why is it becuase i am using VB.net and the COM add-in dll uses VB 6??
below is my code in case i am doing some think wrong? i put the some code in
to VBA in word and it works and does the Execute fine so that shows that the
COM add-in works i did that in word 2003 and the COM ADD-IN is for Outlook
2003?

What do i need to change or doing wrong?


DocumentsButton() As Office.CommandBarButton

ProcessButton() As Office.CommandBarButton


Code:
Dim oCM As Object
Set olApp = CreateObject("Outlook.Application")

Set oCM = olApp.COMAddIns.Item("OutlookCRM.Connect").Object


oCM.ContactComboBox.Text = "da"
'MsgBox (oCM.ProjectButton.TooltipText)

oCM.ProcessMode = 2
MsgBox(oCM.Control.ProcessButton.Visible)
MsgBox(oCM.Control.ProcessButton.Enabled)

oCM.Control.DocumentsButton.Visible = True
oCM.Control.DocumentsButton.Enabled = True
oCM.Control.DocumentsButton.Execute()


oCM.Control.DocumentsButton.Visible = True
oCM.Control.DocumentsButton.Enabled = True
oCM.Control.DocumentsButton.Execute()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top