Tont
2007-09-28 16:59:00 UTC
Hi All
I'm building an AddIn that adds a CommandBar and buttons to the current
document (actually it's a template). To attach the CommandBar to the current
document rather than the Normal template I'm obviously setting the
CustomizationContext. To do this I use:
CustomizationContext = ActiveDocument
The code then does its thing and builds the CommandBar. I then restore the
CustomizationContext:
CustomizationContext = NormalTemplate
Now this is where the fun begins, at this point the CommandBar is not
visible. And yes its Visible property has been set to True. The CommandBar
remains invisible until until you either:
- Switch to another Word document (assuming you have one open! - but not
another application window).
- Use Tools>Customize (you don't need to do anything, just click on the
"Close" button".
- Close and reopen the document.
I've tried all kinds of kludges - but no luck so far.
If anyone has run into this problem or can offer any insights I'd really
appreciate any help you can offer.
Thanks for taking the time to read this + Cheers - Peter.
I'm building an AddIn that adds a CommandBar and buttons to the current
document (actually it's a template). To attach the CommandBar to the current
document rather than the Normal template I'm obviously setting the
CustomizationContext. To do this I use:
CustomizationContext = ActiveDocument
The code then does its thing and builds the CommandBar. I then restore the
CustomizationContext:
CustomizationContext = NormalTemplate
Now this is where the fun begins, at this point the CommandBar is not
visible. And yes its Visible property has been set to True. The CommandBar
remains invisible until until you either:
- Switch to another Word document (assuming you have one open! - but not
another application window).
- Use Tools>Customize (you don't need to do anything, just click on the
"Close" button".
- Close and reopen the document.
I've tried all kinds of kludges - but no luck so far.
If anyone has run into this problem or can offer any insights I'd really
appreciate any help you can offer.
Thanks for taking the time to read this + Cheers - Peter.