Distributing Themes?

D

Dstars

I've created a set of templates in Word 2007 that I want to distribute to all
the employees at the company that I work for. I assumed that the colour- and
font-theme that I created would be saved together with the template, but
apparently that's not the way it works.

I realize that it's possible to save the theme separately, and then instruct
everyone to download said theme to their own Document Themes folder, but I'm
wondering if that's the way you're supposed to do this, or is there an easier
way? Ideally I would like to set this theme as the default whenever someone
opens my templates.

TIA
 
J

Jay Freedman

As far as I've been able to determine, this is indeed the way you're
supposed to distribute themes -- they are not stored in templates.

You can set your theme as the default for your template by including
this macro in your template (see
http://www.gmayor.com/installing_macro.htm if needed), modifying the
file name as needed:
Sub AutoOpen()
Dim ThemePath As String
Dim ThemeFile As String

ThemeFile = "MyTheme.thmx"
ThemePath = Options.DefaultFilePath( _
wdUserTemplatesPath) & _
"\Document Themes\"

On Error Resume Next
ActiveDocument.ApplyDocumentTheme _
ThemePath & ThemePath
If Err <> 0 Then
MsgBox ThemeFile & " was not found in" & _
vbCr & ThemePath
End If
End Sub

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 
D

Dstarss

Thanks so much for the the help. This works great in Word, and I thought it would be the same for Powerpoint, but every time I try to run this in Powerpoint I get a Run-time error '424': Object required. Am I missing something or doesn't the macros work the same in Word/PowerPoint etc.
 
J

Jay Freedman

Dstarss said:
Thanks so much for the the help. This works great in Word, and I
thought it would be the same for Powerpoint, but every time I try to
run this in Powerpoint I get a Run-time error '424': Object required.
Am I missing something or doesn't the macros work the same in
Word/PowerPoint etc.

The macro in my previous post is specific to Word, because it contains
references to things that exist only in Word VBA, such as
Options.DefaultFilePath and ActiveDocument. (And it contains a typographical
error; the line "ThemePath & ThemePath" should be changed to "ThemePath &
ThemeFile".)

The equivalent macro for PowerPoint is this:

Sub AutoOpen()
Dim ThemePath As String
Dim ThemeFile As String

ThemeFile = "MyTheme.thmx"
ThemePath = Environ("appdata") & _
"\Microsoft\Templates\Document Themes\"

On Error Resume Next
ActivePresentation.ApplyTheme _
ThemePath & ThemeFile
If Err <> 0 Then
MsgBox ThemeFile & " was not found in" & _
vbCr & ThemePath
End If
End Sub

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
D

Dstarss

Once again, thank you. I fixed the syntax error but forgot to mention it before. Sorry to bother you again, but is there a similar variable that allows you to change just the theme font/colour/effect, something like ActivePresentation.ApplyFont ?
 
J

Jay Freedman

Once again, thank you. I fixed the syntax error but forgot to mention it before. Sorry to bother you again, but is there a similar variable that allows you to change just the theme font/colour/effect, something like ActivePresentation.ApplyFont ?

I really don't know that much about VBA in PowerPoint, but a quick
scroll through the VBA Help didn't turn up anything that looked like
that. I suggest you ask this question in a PowerPoint group.
 
J

Jay Freedman

I've obviously not copied the .thmx file over, but isn't that the point
of this macro? Or am I missing something? I don't want to have to make
my co-workers copy the .thmx file to each of their hard drives into the
exact correct location....

No, the point of the macro I posted was to load an existing theme file
into the current document, as requested by the original poster in the
thread. It was *not* to create the theme formatting when the .thmx
file doesn't exist.

It should be possible to write a different macro that creates the
desired formatting and saves it as a .thmx file. But, as I said
before, PowerPoint macro programming isn't my area, so it would be
better to ask in a PPT forum.
 
R

Robert M. Franz [RMF]

Hello Dstars
I've created a set of templates in Word 2007 that I want to distribute to all
the employees at the company that I work for. I assumed that the colour- and
font-theme that I created would be saved together with the template, but
apparently that's not the way it works.

I realize that it's possible to save the theme separately, and then instruct
everyone to download said theme to their own Document Themes folder, but I'm
wondering if that's the way you're supposed to do this, or is there an easier
way? Ideally I would like to set this theme as the default whenever someone
opens my templates.

Themes are a great new feature for all-purpose templates/documents. To
use themes effectively, you need theme-ready templates.

But when you go through the trouble of creating a company template, you
normally want to adhere to a pre-specified set of fonts, sizes, etc.
(part of a CI/CD). I'm not sure if you want to create theme-ready
templates in the first place, then, and risk letting your folks (more
easily) create colorful business reports in fancy fonts ...

2¢
Robert
 

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