Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language

Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

C# Programming

Calling MS Word Letter Wizard?

How can I call the Microsoft Word Letter Wizard from within a C# Windows
application? And once I open the Letter Wizard from the application, can I
automatically paste text on one of the fields (specifically the Delivery
Address field in Recipient Info Tab)?

I'm using VS 2005 and MS Word 2002.


You need to create a COM reference to the MS Office Primary InterOp

From there, you make an instance of the Word Application and away you go....

Don't forget to call Marshall.ReleaseComObject(comObjectReference) when you
are done with any COM instances you make.

"VMI" <no email> wrote in message


Would you have any links that would help me with that?

Thanks again.

"Scott M." <s@nospam.nospam> wrote in message


"VMI" <no email> wrote in message


> Would you have any links that would help me with that?





Since the Letter Wizard is a template, after invoking it, you will not have
full control of the dialog to enter the delivery address. I think you can
use some GUI automation library to automate the operations. For example:

To learn how to invoke the Letter Wizard in C#, you need to first know
which object model is used in Word automation, you can first record a macro
in Word to get some idea. For example, following is the VBA code needed to
invoke the Letter Wizard:

Documents.Add Template:= "C:\Program Files\Microsoft
Office\Templates\1033\Letter Wizard.wiz", NewTemplate:=False,

Hope this helps.

Walter Wang (waw@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

This posting is provided "AS IS" with no warranties, and confers no rights.

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc