Office COM addin: How can you remember last position of icon using Extensibility2 with C++?

M

Mary

I've written a COM add-in for Office in C++ and everything works fine
using Extensibility2 (OnConnection, OnDisconnection, etc.).


But, when I move my icon, close Word, and then launch Word again, my
icon appears in the original location and not the new location I just
moved it to.


How can I get the new position of the icon? I assume this would be done
OnDisconnection (and I
assume that I would just save it to the registry) or is there another
way?

And, how do a set this new position OnConnection (or somewhere else)
for the icon?


Any suggestions would be greatly appreciated.


Also, if anyone knows of a good book that goes over this that would be
helpful.


Thank you.


-Mary
 
B

- B@rney

The CommandBarButton has a property called Index that gives it's position.
You can stash that away for future reference.

I want my button to be next to the default Save button, so I get a reference
to it (it's control[3]) and place my button at oSaveButton.Index + 1.

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top