msoControlActiveX Add-In madew with CSharp not showing at load?

J

John

I made a Word-Addin which adds a UserControl to a commandBar.
That part works only it doesn't show the control when it load the
commandbar,but as soon as I use VBA in a Word macro and add a Form with that
same control it
shows the button in the commandbar in Word.

How come? DidI forget some initialize command in the add-In?
I'm using Office XP and Visual Studio .Net 2003.

Any help is welcome.

Regards,
John
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?Sm9obg==?=,

Show us the code that works with the CommandBar object and adds the control to
it, please?
I made a Word-Addin which adds a UserControl to a commandBar.
That part works only it doesn't show the control when it load the
commandbar,but as soon as I use VBA in a Word macro and add a Form with that
same control it
shows the button in the commandbar in Word.

How come? DidI forget some initialize command in the add-In?
I'm using Office XP and Visual Studio .Net 2003.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 
J

John

I tried with multiple combination and this is I guess the simplest one:
I made a CSharp DLL with a UserControl and enabled the COM Interop.

And after looking up the CLSID I used the following macro in word:
Sub test()
Set ctrl = Application.CommandBars("test").Controls.Add(msoControlActiveX)
ctrl.ControlCLSID = "{828FF120-190F-3F8B-A307-3FAACF785479}"
End Sub

That's it.
 

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