Group:  General ยป microsoft.public.officedev
Thread: from .dot to .dll

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

from .dot to .dll
Hendrik Jan 27.10.2005 07:42:03
Hi,

In Ms Office 2000 we developed a dot file that crates a commandbar +
commandbarbutton in Ms Word. When you click on this button, the program
retrieves data from the database and puts it in your Ms Word document. Now we
are trying to build the same functionality in a dll. Therefore I started in
Office Developer 2000 a "addin" vba project. In the AddInDesigner I linked
the project to Ms Word with "Startup" as initial load behavior. In the code I
declared a commandbarbutton (Private WithEvents cbb As
Office.CommandBarbutton) that is placed in the commandbar in the
"IDTExtensibilty2_OnConnection". I copied the code (modules and forms) from
the dot file into modules and forms in this vba project. When I click the
commandbarbutton this code is started. When I start Ms Word the
commandbarbutton is created and clicking on it, the code starts as I want.
But this works only in the first document (document 1) in Ms Word. When I
create a new (document 2) document in Ms Word or I open a saved document, the
commandbarbutton is there, but when I click on it then nothing happens.

Can anyone help me with this?

Thanks,
Hendrik Jan
RE: from .dot to .dll
Hendrik Jan 03.11.2005 08:58:09
Hoi,

I just solved the problem. When I define an unique string in the tag
property of the commandbarbutton, it works for all documents.

cbb.tag = "UNIQUE"

"Hendrik Jan" wrote:

[Quoted Text]
> Hi,
>
> In Ms Office 2000 we developed a dot file that crates a commandbar +
> commandbarbutton in Ms Word. When you click on this button, the program
> retrieves data from the database and puts it in your Ms Word document. Now we
> are trying to build the same functionality in a dll. Therefore I started in
> Office Developer 2000 a "addin" vba project. In the AddInDesigner I linked
> the project to Ms Word with "Startup" as initial load behavior. In the code I
> declared a commandbarbutton (Private WithEvents cbb As
> Office.CommandBarbutton) that is placed in the commandbar in the
> "IDTExtensibilty2_OnConnection". I copied the code (modules and forms) from
> the dot file into modules and forms in this vba project. When I click the
> commandbarbutton this code is started. When I start Ms Word the
> commandbarbutton is created and clicking on it, the code starts as I want.
> But this works only in the first document (document 1) in Ms Word. When I
> create a new (document 2) document in Ms Word or I open a saved document, the
> commandbarbutton is there, but when I click on it then nothing happens.
>
> Can anyone help me with this?
>
> Thanks,
> Hendrik Jan

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net