Toolbar position

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

Toolbar position
 
Rick Koch




Posts: 172
Joined: 2006-09-05
Tinkering with my first toolbar, the application seems to have remembered the rowIndex and position after exiting and restarting Outlook. Is this correct, and if so, what's the mechanism? Or is it that Outlook or the CLR simply retained this as a glitch?

I want an inspector toolbar whose options might change as I scroll through the contents of an inbox. For example, I'd offer different options on meetingitems than on mailitems. How would I control this?

I selected the same faceid I've been using in my project, but my button has no image. There are properties for commandbarbutton images, but no explanation of how to use them. In production, we'd like to use custom icons -- will this be possible?

If I want to assign a toolbar to the default contacts folder, that path will not be constant. I'd guess I want to get the default contacts folder and then apply that folder's name to the folder name for the contacts toolbar, but the toolbar is a private object in the adx module. How do I manipulate it -- I couldn't find a "place your custom code here" region in the code view.

Forgive the questions; this is my first look at this tool and there's no documentation. I'm eager to use anything that takes the headache out of programming dynamic, context-sensitive toolbars.

Rick
Posted 11 Sep, 2006 12:04:55 Top
Sergey Grischenko


Add-in Express team


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

Yes, in Outlook ADX stores positions of its command bars . This information is stored in the system registry.

want an inspector toolbar whose options might change as I scroll through the contents of an inbox. For example, I'd offer different options on meetingitems than on mailitems. How would I control this?

You can use the OlExplorerItemTypes property to switch between specific options.

I selected the same faceid I've been using in my project, but my button has no image. There are properties for commandbarbutton images, but no explanation of how to use them. In production, we'd like to use custom icons -- will this be possible?

1. Add the ImageList component to the addinmodule.
2. Set the Images property of the add-inmodule to the image list added above.
3. Select the image you need in the Image property of the button.
4. Set the ImageTransparentColor property of the button to the transparent color.
5. Set the Style property of the button to adxMsoButtonIcon or adxMsoButtonIconAndCaption.

If I want to assign a toolbar to the default contacts folder, that path will not be constant. I'd guess I want to get the default contacts folder and then apply that folder's name to the folder name for the contacts toolbar, but the toolbar is a private object in the adx module. How do I manipulate it -- I couldn't find a "place your custom code here" region in the code view.

All .NET components have the Modifiers property to change the access level. You can modify the FolderName and FolderNames property of the command bar in the AddinInitialize event handler.

Forgive the questions; this is my first look at this tool and there's no documentation. I'm eager to use anything that takes the headache out of programming dynamic, context-sensitive toolbars.

Our documentation is located in the ADX installation directory.

Posted 12 Sep, 2006 05:28:54 Top
Rick Koch




Posts: 172
Joined: 2006-09-05
Okay, I'm making real progress now.

Where in the registry are toolbar positions stored?

I don't see the "AddinInitialize" handler -- where is that? What I want to do is set some string constants to the paths of the default inbox, calendar, sent items, draft items, contacts and tasks folders. Then I want to use these calculated values in the FolderNames collection. The same toolbars would be used everywhere, but button visibility would be linked to the FolderSWitch or SelectionChange events.

Related question:
When composing a reply to an email, the reply is located in the Inbox, but its .Sent property is false. I suppose it could also be in the Drafts folder if the user has saved it.

If I want to offer one button for sent items and a different button for unsent items in the Inbox, how would this be coded? I mean, I guess I can hook into the NewInspector event to see if the item's been sent -- is that the way I should do it, or would you recommend another approach?

I don't see the docs. I'm using the latest beta of the VSTO product. In the application directory I have licence.txt, readme.txt and whatsnew.txt. In my docs directory I see licence.rtf Is there a filename I should be looking for?
Posted 12 Sep, 2006 13:26:58 Top
Rick Koch




Posts: 172
Joined: 2006-09-05
I'm using the VSTO 2005 version. Does this version have AddinInitialize? Should I be using another event/method?
Posted 12 Sep, 2006 17:25:00 Top
Sergey Grischenko


Add-in Express team


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

ADX stores the positions in the 'HKEY_CURRENT_USER\Software\Microsoft\Office\Outlook\AddIns\<MyAddin.AddinModule>\CommandBars\Positions' registry key.

The ADXModule doesn't have the AddinInitialize event. Please use the OnInitialize or OnStartupComplete events instead.
Note: The OnInitialize event doesn't fire in the current version of ADX for VSTO product. This issue will be fixed in the next build.

When composing a reply to an email, the reply is located in the Inbox, but its .Sent property is false. I suppose it could also be in the Drafts folder if the user has saved it.

Yes, correct.

If I want to offer one button for sent items and a different button for unsent items in the Inbox, how would this be coded? I mean, I guess I can hook into the NewInspector event to see if the item's been sent -- is that the way I should do it, or would you recommend another approach?

You can use the approach applied in the following example:
http://www.add-in-express.com/projects/newmessageexample.zip
The example is based on the ADX.NET product but you can implement the same technique for the 'ADX for VSTO' add-in as well.

I don't see the docs. I'm using the latest beta of the VSTO product.

Sorry, Rick. I just thought that you ment the ADX.NET product.


Posted 13 Sep, 2006 08:27:15 Top
Rick Koch




Posts: 172
Joined: 2006-09-05
Currently, I'm seeing events in this order (using OL2003):

beforeinitialization
startup
newexplorer
startupcomplete
afterinitialization

Where in the process would oninitialize fire?

When will the next build occur (and when will beta be over)?

Why would I use InspectorActivate to handle sent/unsent items intead of NewInspector?
Posted 13 Sep, 2006 11:32:07 Top
Rick Koch




Posts: 172
Joined: 2006-09-05
Sorry; beforeinitialization and afterinitialization are not events -- they're messages I added around the call to InitializeComponent().

Also, I see there are two constructors -- why the overload? Just trying to be sure I understand where I can put code such that it will fire exactly once during startup.

Rick
Posted 13 Sep, 2006 12:10:55 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
The OnInitialize event fires before ADX controls are installed.
The OnStartupConplete event fires after ADX controls are installed.
Now you can put the initialization code in the OnStartupComplete event handler or in the ThisApplication_Startup event handler of the VSTO application class.

When will the next build occur (and when will beta be over)?

We will publish it in a month or two.

Why would I use InspectorActivate to handle sent/unsent items intead of NewInspector?

The InspectorActivate event fires whenever the Outlook inspector window is activated. You need this event to show/hide command bars.

Also, I see there are two constructors -- why the overload? Just trying to be sure I understand where I can put code such that it will fire exactly once during startup.

You shouldn't use constructors of the ADXModule class. Please use the initialization events mentioned above.
Posted 13 Sep, 2006 15:45:20 Top
Rick Koch




Posts: 172
Joined: 2006-09-05
Will OnInitialize permit me to dynamically name the default contacts folder, inbox, etc. between the time the module is defined and the time the toolbars are displayed?
Posted 14 Sep, 2006 16:28:36 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Yes, it will.
Posted 15 Sep, 2006 09:08:32 Top