Word styles & multiple templates

R

Rob Stewart

I have a Word template with VBA code that needs to run on startup, so this is
the template attached to my documents.

I also have a need to supply a range of Word styles to users via a template.

I realise I can have these styles in my Attached Template and check the
"Automatically update document styles" box in "Templates & AddIns", however I
would rather keep the template with code, and the template with styles,
separate.

Can I have code.dot as my attached template, and styles.dot (or even
normal.dot) provide styles to my document, or can styles only be
automatically supplied by the attached template?

Hope that's not too confusing.

Cheers,
Rob
 
P

Peter Huang

Hi,

I am research the issue, and I will update you with new information ASAP.
If you have any more concerns on it, please feel free to post here.


Thanks for your understanding!

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
M

Michael Herzfeld [MSFT]

This should do the trick:

1. Create the style template.
2. Create the code template.
3. In the style template, open VBE and add a reference to the code template
using Tools|References.
4. Also in the style template, add an AutoOpen macro that calls into the
code template to run your startup code.

Michael Herzfeld
Microsoft Office Programmability Test Team

This post is provided 'as-is' without warranty and confers no rights.
 
P

Peter Huang

Hi

Based on my knowledge, a doc file can only be created based on one template
file.
So for your scenario, I think we would better to create a doc file based on
the style.dot, and manually copy the vba copy into new created doc file.
Because although we can invoke the macro on another dot, but the startup
macro must lie in the same doc file.
Or if we created based on code.dot, then we need to copy the style.dot
file's content into current doc file.

Hope this helps.
If you still have any concern, please feel free to post here.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 

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