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

D

dorling

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()
 
S

sk

So you can't not make the button clickable?
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
this only proves the addins works in VBA but might not work in com addin.

There are a couple of samples for office addins at microsoft.com
Probabaly, you can go from there...


Shinya
 
S

sk

Have you played with those parameters?
Private Sub m_cbcDisconnectButton_Click(ByVal Ctrl As
Office.CommandBarButton, _
CancelDefault As Boolean)

otherwise you put whatever you are doing inside of click event into a
function and
call the function where you want to simulate click event in your program.

Shinya
 
D

dorling

right ok i see

do you know any where i can get example to download to made COM add-in for
word and outlook 2003?

fro use with vb.net?


JOnathan
 

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

Top