Board index » delphi » How to change Word-menu's from within Delhi DLL (Using COM)

How to change Word-menu's from within Delhi DLL (Using COM)

My goal is to have a standalone add-in for Word 8, written in Delphi, that
is able to adjust the Word-menu, and thus have the user create standardized
documents by displaying  dialogs which fills out template based documents.
The add-in must in no way interfere with normal.dot or other templates.

To do this I tested creating a .WLL (is a renamed DLL, so Word recognizes
it as an Addin). I managed already to have the .wll talk to Word by using
COM/OLE (GetActiveOleObject function from ComObj unit). I get stuck when I
try to do anything with COM when the .wll initializes (wdAutoOpen
function), because the named function does only work after the .dll is
initialized. I need this to initialize my menu's in word. (At least I
thought so.)

Does anyone know how to do this? Are there better solutions?

 

Re:How to change Word-menu's from within Delhi DLL (Using COM)


Leo--

1. I'm not at all convinced of your assumption that a WLL is simply a DLL
with a different extension. For one thing, WLL's have been talking to Word
since long before Microsoft worked out OLE automation.

2. My approach has been more mixed than yours (although we're both shunning
Normal.dot). I employ a custom global template that contains the Word
service routines I need, including customized commandbars. The macros in the
global provide what's simple to do internally, or call on a Delphi-written
dll for more complex requirements (such as selecting and inserting
boilerplate). Actual document templates generally only provide text styles
and letterhead-type stuff.

Let me know if any of this is interesting to you.

BobD

Quote
Leo Hordijk wrote in message <01bd47a0$6796d6c0$21dbdc91@homepc>...
>My goal is to have a standalone add-in for Word 8, written in Delphi, that
>is able to adjust the Word-menu, and thus have the user create standardized
>documents by displaying  dialogs which fills out template based documents.
>The add-in must in no way interfere with normal.dot or other templates.

>To do this I tested creating a .WLL (is a renamed DLL, so Word recognizes
>it as an Addin). I managed already to have the .wll talk to Word by using
>COM/OLE (GetActiveOleObject function from ComObj unit). I get stuck when I
>try to do anything with COM when the .wll initializes (wdAutoOpen
>function), because the named function does only work after the .dll is
>initialized. I need this to initialize my menu's in word. (At least I
>thought so.)

>Does anyone know how to do this? Are there better solutions?

Other Threads