Word addin tied to document Property

  • Thread starter Michael Schnell
  • Start date
M

Michael Schnell

All,

I'm trying to write a VB6 addin for Word XP that will "create" a drop down
box indicating a certain classification to the "document". This being,
among others, Confidential, Internal Use Only, etc. This is supposed to be
tied to the individual document and will be printed out in the footer of
each document.

I've gotten the commandbar and combo box to appear and gotten this to work
with one document. However, as soon as a second document is created/opened
(while the first is still open), the whole thing just seems to stop working.
The box is still there, but any changes I make to the box in the second
document seem to apply to the first document and nothing happens on the
first.

This is probably related somehow, but I'm also getting an error when trying
to set the .OnAction property of the combobox. I have the .OnAction item
set to what it's supposed to be (MyDll name.Connect class), but I keep
getting the error "The macro cannot be found or has been disabled because of
your Macro security settings" whenever I change the combo box contents and
the .OnAction property was set. If I comment out that line, the error
doesn't show. However, I know that it's not the security settings because
I've got the macro security set to Low (this is inside a VPC on a
disconnected laptop, so the security isn't a problem).

TIA,

Michael Schnell
(e-mail address removed)
 
W

Wei Lu [MSFT]

Hello Michael,

I would like to suggest you add a tag property of the CommandBarButton to
have a try.

Click Event Is Not Raised for a Custom Word CommandBarButton Object
http://support.microsoft.com/kb/826931/en-us

Sincerely,

Wei Lu

Microsoft Online Community Support

==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
T

Tantras35

I do have a tag property assigned to my control, but in addition, it's
not a CommandBarButton, but a CommandBarComboBox.

Also, this has been created using VB6 as a COM AddIn, not managed
code.

Michael Schnell
 
T

Tantras35

I want to note that I found this KB article:

http://support.microsoft.com/kb/280427

WD2002: OnUpdate Event Fails Updating CommandBars in Different
Document


When I make the changes indicated here, my combobox seems to work (I
haven't completely tested everything yet). However, I'm not sure
whether I can indicate that all copies of Word 2002 must be set to MDI
(and not SDI). Has there been any updates or fixes made that would
avoid having to indicate that Word MUST be run in MDI mode and not
SDI.

Thank you

Michael Schnell
 
W

Wei Lu [MSFT]

Hello Michael,

Currently, I did not get the update for this issue. Have you tried on Word
2003?

Sincerely,

Wei Lu
Microsoft Online Community Support

==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
T

Tantras35

No, I have not yet tried this on anything newer than Word XP, because
my client is still using Word XP (office XP), although they are in the
planning process of rolling out an upgrade to Word 2007 (Office
2007).

I will be testing this against word 2007 shortly, but it needs to run
against Word XP for at least several months until the rollout of 2007
is complete.

Michael Schnell
 
W

Wei Lu [MSFT]

Hello Michael,

Could you generate a simple sample code so that I can help to tested on my
side?

Sincerely,

Wei Lu
Microsoft Online Community Support

==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
B

Brian McCullough

Wei,

I am having a similar problem and my code is posted in the posting titled:
"Word AddIn using ComboBox in Standard Toolbar".

-Brian
 

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