Programmatically inserting a Macro into a document

J

John Clark

Help?

I am writing an application to create a Word document - this document
needs the support of a macro to manipulate Style definitions.

How can my application create a new Macro in the Word document I am
creating? I have looked through the VBA reference for Microsoft Word,
but I don't see any place to add a Macro to the document.

Thanks,
-jdc
 
D

Doug Robbins - Word MVP

The macro should reside in the template from which you create the new
document. It will then be available for use with the document.
Alternatively, if the macro resides in a template that is stored in the Word
Startup folder, that template will be loaded as an addin when Word is
started and the macros in it will be available for use with all documents.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

Help?

I am writing an application to create a Word document - this document needs
the support of a macro to manipulate Style definitions.

How can my application create a new Macro in the Word document I am
creating? I have looked through the VBA reference for Microsoft Word, but I
don't see any place to add a Macro to the document.

Thanks,
-jdc
 

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