ActiveDocument.ApplyTheme results in empty error message box

H

Hoazl

Hello!
I try to apply a new Document Theme to my Document with a VBA-Macro. But if
i execute my code:
ThisDocument.ApplyTheme ("ANANKE 011")
a message box pops up, with no text in it and the red error-logo.

Can someone tell me how to apply a new theme to the document with VBA? And
why theres an empty MessageBox?

I'm using Office Word 2007.

Yours,
Hoazl
 
T

Tony Jollans

I don't know why you get a missing error message (perhaps you need to repair
your installation) but are you sure that you have this theme in the default
location; if not, you have to specify the path as well as the name.
 
H

Hoazl

Hi Tony, Thanks for your reply.
I just found out that I get an emtpy error message if I use the Button in
the Ribbon (I played a bit around with modifying my Fluid UI ;) ).
If I execute the following code:
Sub test()
ThisDocument.ApplyTheme ("Solstice.thmx")
End Sub
, I get the error message "The specified theme could not be found.".
I tried around with various modifications of the Parameter (with or without
the full path, with file ending thmx, with escaped backslashes in the full
path), but everytime I ended up with the same error message.

Yours,
Hoazl
 
T

Tony Jollans

If you want to apply a 2007 Theme you should use ApplyDocumentTheme.
ApplyTheme applies pre-2007 themes - different beasts entirely.
 
H

Hoazl

Thanks, Tony, for your Reply, ApplyDocumentTheme worked perfectly for me!

Yours,
Hoazl
 

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