Create Word macro in C#

P

paulinda

I have a document that I want to add a macro to at run time in a C
program. The macro will tell Word to change the printer but not chang
the default printer. I know how to run the macro from the program bu
is there a way to edit the macro or create a new one? I need to be abl
to change the printer dynamically
 
C

Cindy M -WordMVP-

Hi Paulinda,
I have a document that I want to add a macro to at run time in a C#
program. The macro will tell Word to change the printer but not change
the default printer. I know how to run the macro from the program but
is there a way to edit the macro or create a new one? I need to be able
to change the printer dynamically.
It's possible, but it's rather esoteric. And the option to "Trust Access
to Visual Basic Project" has to be turned on in Macro Security (it's not
something you can automate) in order for it to work.

It involves using the Visual Basic Extensibility object library to create
VBComponents in the current VBProject. You might want to pursue this in
an Office.Developer or possibly a Word.VBA newsgroup, as you'll mostly
encounter only end-users in this group.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 

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