create multiple instances of new Word Toolbar

T

tingletanglebob

Hi,

I am currently developing a COMAddIn which uses information of an EDRMS
system. I incorporated a toolbar with a dropdown box which displays the
status of an document (The Information comes from the EDRMS DB). When I am
switching between multiple instances of e.g. Excel or PPoint the dropdown box
displays the status according to the documents information in the DB. In
short words every active window always shows the appropriate status of a
document in the new dropdown control.

Now my problem:
Word behaves different by opening for every new document a complete new
instance with all toolbars (rather than having all toolbars once, like in
Excel). When I switch now between two or more Word-Documents (that are all
aranged side by side) the dropdownbox has for every window the same value
(related to the currently active document), e.g. doc1 one has status
"pending" and doc2 has "approved" and doc1 is active BOTH toolbars has
"pending"; do I change to doc2 BOTH doc-windows have "approved".

Is there any chance to give the dropdown box just the value of the belonging
window? The problem is: I use the application object from OnConnection and it
is just loaded once, hence the same reference - is there not a workaround
(e.g. the dropdown from the font is not changing between different word
windows - how to achieve the same behaviour with a custom one)

Many thanks in advance!
 
H

Helmut Obertanner

Hello Bob,

I'm not to deep in Word development, but you can give each Button a unique
Tag, relating to the Document, e.g. GetHashcode().
So, when your Window get's activated, check the Hashcode and Update only the
Button with the correct Tag.

Hope this helps,

regards
--
Helmut Obertanner
Technical Consultant
Softwaredevelopment
DATALOG Software AG | Zschokkestr. 36 | D-80687 Munich

.... and IT works!
 

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