Add a custom menu in Word

Add-in Express™ Support Service
That's what is more important than anything else

Add a custom menu in Word
 
Bob Dylan




Posts: 22
Joined: 2008-07-01
Hi all,

Wondering if anyone can help - I'm looking to add a custom menu to Word 2003 which reads the templates in a folder and lists them in the menu drop down. Preferably with a sub menu if a sub-folder exists. I have no idea how to acheive this and have tried reading through the loads of info - can anyone help me or point me in the right direction?

Thanks,
B
Posted 01 Jul, 2008 14:50:33 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Bob,

I assume that you mean a context menu. You can handle the BeforeAddControls event from AddinExpress.MSO.ADXContextMenu component to add context menu items. To add the component to the add-in module, right click and select Add Context Menu item.
.NET, Extended MAPI, Windows Phone & RT
Posted 02 Jul, 2008 09:32:13 Top
Bob Dylan




Posts: 22
Joined: 2008-07-01
Hi,

Not really what I was looking for - but I have managed to make some progress using the main menu control. How do I simply launch a word template when someone clicks on the option in the main menu drop down? Any ideas?

Thanks,
B
Posted 02 Jul, 2008 10:26:58 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Bob,

You should use the Open function of the Documents collection in Word.
.NET, Extended MAPI, Windows Phone & RT
Posted 02 Jul, 2008 10:46:07 Top
Bob Dylan




Posts: 22
Joined: 2008-07-01
Hi,

Ok - how?

Thanks,
B
Posted 08 Jul, 2008 07:51:51 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Bob,

I have tested the following code:


object path = @"D:ggggg.doc";
object read_only = false;
object visible = true;
object _false = false;
object _true = true;
object dynamic = 2;
object missing = Type.Missing;

Word.Document worddoc = WordApp.Documents.Open(ref path, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing);
.NET, Extended MAPI, Windows Phone & RT
Posted 08 Jul, 2008 09:34:30 Top
Bob Dylan




Posts: 22
Joined: 2008-07-01
Hi Eugene,

Thanks v much for this - I think it works, well at least it builds. How do I publish my app? I've clicked build then publish and it tells me that the application has been published successfully, but how do I install it? All the files in the publish directory have the .deploy extension.

I now need to install my app so that hopefully my additional menu option appears in Word.

Thanks,
B
Posted 10 Jul, 2008 04:47:58 Top
Andrei Smolin


Add-in Express team


Posts: 17243
Joined: 2006-05-11
Hello Bob,

See Deploying Add-in Express Projects in <Add-in Express install folder>\Docs\adxnet.pdf.

Regards from Belarus (GMT+2),

Andrei Smolin
Add-in Express Team Leader

Posted 10 Jul, 2008 05:17:38 Top
Bob Dylan




Posts: 22
Joined: 2008-07-01
Hi,

Ok - thanks very much. I have now managed to deploy and install my application - it shows up in my start menu which is great - but now how do I go about actually adding the ad-in into Word so that my menu appears? There are no WLL files on my hard drive so I'm not sure how to add it.

Thanks,
B
Posted 10 Jul, 2008 09:17:17 Top
Andrei Smolin


Add-in Express team


Posts: 17243
Joined: 2006-05-11
Hi Bob,

Add-in Express doesn't support WLLs. I assume that you develop a COM add-in instead. Now I do not understand, isn't the add-in shown in the COM Add-ins dialog after you install it? Do you install it via ClickOnce?

Regards from Belarus (GMT+2),

Andrei Smolin
Add-in Express Team Leader
Posted 10 Jul, 2008 09:36:39 Top