473,511 Members | 15,197 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Calling MS Word Letter Wizard?

VMI
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.

Thanks.
Jun 5 '07 #1
5 1730
You need to create a COM reference to the MS Office Primary InterOp
Assemblies.

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 emailwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
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.

Thanks.

Jun 5 '07 #2
VMI
Would you have any links that would help me with that?

Thanks again.
"Scott M." <s-***@nospam.nospamwrote in message
news:eJ**************@TK2MSFTNGP04.phx.gbl...
You need to create a COM reference to the MS Office Primary InterOp
Assemblies.

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 emailwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
>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.

Thanks.


Jun 5 '07 #3
"VMI" <no emailwrote in message
news:OT**************@TK2MSFTNGP03.phx.gbl...
Would you have any links that would help me with that?
http://support.microsoft.com/kb/819398
--
http://www.markrae.net

Jun 5 '07 #4
Hi VMI,

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:
http://www.ranorex.com/

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,
DocumentType:=0
Hope this helps.
Regards,
Walter Wang (wa****@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.

Jun 6 '07 #5
Hi VMI,

Have you seen my last reply? Please feel free to let me know if there's
anything unclear. Thanks.
Regards,
Walter Wang (wa****@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.

Jun 11 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
5989
by: Eric A. Johnson | last post by:
Hi, Thanks for reading this. How do I list all possible permutations of a word? I've figured out how to get all the characters in alphabetical order. I then want to display every possible...
10
3863
by: Case Nelson | last post by:
Hi there I've just been playing around with some python code and I've got a fun little optimization problem I could use some help with. Basically, the program needs to take in a random list of no...
4
1142
by: Helen Trim | last post by:
I have an application that allows users to edit documents using Word 2000. Sometimes it opens Word but the toolbars are missing. Users find this very frustrating. I can't track it down as it is...
2
3355
by: Colin Halliday | last post by:
I have a Word 2003 mail merge main document (form letter) that is linked to another Word document data source for the mail merge. If I open this doc using the Word GUI, it first asks me to...
12
10635
by: Dixie | last post by:
Is there a way to shell to Microsoft Word from Access and load a specific template - using VBA? dixie
8
13322
by: Ron B | last post by:
Help!!! What am I doing wrong? I am working with Office 2003 and am trying to create a command button on an Access form that will create a mail merge in Word from an Access table. I want to...
10
1761
by: dave | last post by:
Hello, I made a function that takes a word list (one word per line, text file) and searches for all the words in the list that are 'shifts' of eachother. 'abc' shifted 1 is 'bcd' Please take...
10
4011
by: longshan | last post by:
Hi friends, Can you help me write some code to list all the arrangement of a word? for example "unix" it has possibilities like nixu,ixun,,,and so on. I think we can get 4!(4*3*2*!)=24...
2
1824
by: whodgson | last post by:
The following code accepts a string from the user and swaps the first and last letters in each word. It prints out the original string incorrectly by dropping off the first letter of the first word....
0
7237
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7417
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7506
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5659
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5063
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4734
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3219
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3210
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
780
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.