Changing a document's template (preferably before opening)

A

alanmurphy

Hi,

An application I'm working on needs to change an MS Word document's
assigned template before being spawned. The template we wish to assign
restricts certain menu items (e.g., forbids the user from saving the
document locally) and does some other murky, macro bits and bobs which
I won't go into.

Unfortunately, DSOFile.dll is no use to me in this matter, because
OleDocumentPropertiesClass.SummaryProperties.Template is read only.
I'm not sure what that leaves. I've toyed with prototyping some kind
of a solution that would open the document, but hide it from the user
(along with the undesired menu items) long enough to change the
template behind the scenes via normal (i.e., non-DSOFile.dll)
automation, but it's messy.

I actually have a binary executable that already does this, but it is
very flaky and prone to crashes, hence the need for a rewrite. Worse
still, the flaky executable is ancient and came from a third party,
and we have no source code or way of finding out how it works. The
only hint we ever got was that it wasn't going down a conventional
route (e.g., OLE), but was manipulating the binary of the MS Word file
directly (yuck!)

Any ideas/suggestions/tips/fully coded solutions would be warmly
welcomed.

Cheers,
Al
 

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