XP theme for Office add-in

  • Thread starter Robert Jacobson
  • Start date
R

Robert Jacobson

Hi,

I'm creating a COM add-in for Microsoft Word XP with VB.Net and Visual
Studio 2003. It displays several forms, which I'd like to show using the
Windows XP theme. (I'm familiar with the methods to do this with a managed
EXE -- using the manifest or calling Application.EnableVisualStyles.)

How do I go about doing this with a COM add-in? I've tried calling
Application.EnableVisualStyles (followed by Application.DoEvents) before the
forms display, and get inconsistent results -- sometimes it will display in
the traditional style, and sometimes in the XP style, depending on when I
make the call. Worse, it makes Word very unstable -- it will often crash
randomly when displaying one of my forms.

Is it possible to get the XP style in a COM add-in by using a manifest? If
so, what settings should I use? Are there any other techniques that I
should try?

Thanks,
Robert Jacobson
 
P

Peter Torr \(MS\)

Robert Jacobson said:
I'm creating a COM add-in for Microsoft Word XP with VB.Net and Visual
Studio 2003. It displays several forms, which I'd like to show using the
Windows XP theme. (I'm familiar with the methods to do this with a managed
EXE -- using the manifest or calling Application.EnableVisualStyles.)

How do I go about doing this with a COM add-in?

Hi,

Unfortunately, I don't believe this works reliably (as you have found out).
It's a shame, because obviously you want your code to look "natural" to the
user.

I'll double-check, but I haven't been able to get this to work in the past.

Peter
 
R

Robert Jacobson

Thanks for looking into this, Peter. I hope that's not true, though -- I'd
really like to have the XP style to give my add-in a more "modern" look and
feel. (I've only seen a few pictures of Office 2003 -- does it use XP
styles for dialog boxes?)

Since I'm able to get it to work inconsistently using
Application.EnableVisualStyles, I'm thinking (hoping) that it might be
possible to do with manifests. (EnableVisualStyles() is known to be a bit
buggy even in .Net exe's.) Otherwise, is there any way to enable XP styles
purely through the API, without a manifest?

If the final, official word from Microsoft is that it just isn't possible,
could someone write up a KB article and/or issue a bug report on this? I've
wasted many hours on this, and I can't imagine that I'm the only one who
will encounter this issue.
 
R

Robert Jacobson

FWIW, I just noticed that Office 2003 does indeed use XP styles in dialog
boxes. It would be a double shame if Microsoft spends so much effort on the
VSTools for Office initiative, but doesn't give .Net developers a way to
match the XP look and feel for plug-ins.
 

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