LoadBehavior Word-add

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

LoadBehavior Word-add
 
Ben Van Mulders




Posts: 27
Joined: 2007-03-14
Hi all,

A button on my form opens Word and loads a Word template.
I only want my add-in to be loaded when I click that button, not everytime I open Word.
I've looked at the add-in properties and changed the LoadBehavior to "Connected;LoadOnDemand".
Is this a good start?
(btw Is it automatically unloaded when i close my Word instance ?)

Other issue, i'm using Word 2007 so i've got an Add-In ribbon.
But there's always a Save button on it.
And when i open Word and click that button, my add-in is loaded.
Is this normal behavior?

Greets
Posted 20 Mar, 2007 05:10:38 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Ben.

I've looked at the add-in properties and changed the LoadBehavior to "Connected;LoadOnDemand".
Is this a good start?

No, I would advise you to use the 'ConnectFirstTime' mode so that the add-in can create all UI at startup. Moreover you will have to set the
'!<Add-in ProgID>' parameter to the 'OnAction' property of your button(s) in the AddinStartupComplete event handler. It will allow the host application to load the add-in on demand when the button is clicked.

(btw Is it automatically unloaded when i close my Word instance ?)

I think no.

i'm using Word 2007 so i've got an Add-In ribbon.
But there's always a Save button on it.
And when i open Word and click that button, my add-in is loaded.
Is this normal behavior?

Is the Save button built-in Ribbon control?


P.S. Note that we take up your forum requests in the order we receive them.
Besides, it may take us some time to investigate your issue. Please be sure we will let you know as soon as the best possible solution is found.

Posted 20 Mar, 2007 06:43:11 Top
Ben Van Mulders




Posts: 27
Joined: 2007-03-14
Hi Sergey,

Here's a print screen of the save button when i open Word
http://users.telenet.be/domoor/addin.png

And when i click it, my add-in is loaded...
Don't get it

I even reinstalled Word, but it stays there
Posted 20 Mar, 2007 07:22:38 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Ben, did you add this button using the ADXBuiltInControl component?
Posted 20 Mar, 2007 08:12:22 Top
Ben Van Mulders




Posts: 27
Joined: 2007-03-14
Yeah i guess it was added at a certain point, but now it isn't a part of my add-in no more.
So why is it still showing ?
Posted 20 Mar, 2007 08:19:27 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
It is still shown because the ADXBuiltInControl works incorrectly in Office 2007. The control still has the OnAction property set to the
'!<Add-in ProgID>' value that refers to your add-in.

Please do the following:
1. Add a new ADXCommandBar component to the addinmodule.
2. Set the CommandBarName property to "Menu Bar".
3. Set the UseForRibbon property to true.
4. Add the following code to the AddinStartupComplete event handler:
(adxCommandBar1.CommandBarObj as Microsoft.Office.Core.CommandBar).Reset();
5. Rebuild the project and start Word. The Add-ins tab should desappear.




Posted 20 Mar, 2007 09:30:15 Top
Ben Van Mulders




Posts: 27
Joined: 2007-03-14
Oops, it seems like i posted in the wrong subforum :(
While using the search option i stranded in the wrong one...
So this topic actually belongs in the ".NET Products Forum"

Could you provide me with the correct line of code to add in the AddinStartupComplete event handler? (VB.NET)

Sorry for the trouble and al your help.

Posted 20 Mar, 2007 09:59:52 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
No problem.

adxCommandBar1.CommandBarObj.Reset()
Posted 20 Mar, 2007 10:16:21 Top
Ben Van Mulders




Posts: 27
Joined: 2007-03-14
Sergey, it doesn't seem to do the trick :(

I also tried by creating a whole new project with just that Commandbar with the reset() function.
Posted 21 Mar, 2007 02:55:42 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Ben, to remove the control you should reset the command bar that you used in the CommandBar property of the ADXBuiltInControl component.
Posted 21 Mar, 2007 06:40:10 Top