How ro Get the "Label Options Dialog" in VC++

T

Thiru

i want to Pop up the "Label Options" dialog in my VC++ Exe.Could you please
guide me how to do that.

Thanks in Advance,
Thiru.
 
T

Thiru

Hi All,

I found the solution....
Here is the piece of the Code to Do that...

Step1 : Include the MSWORD.OLB file to your project.

Step2: Create the Objects for Application, Documents,
_Document,MailMerge,MailingLabel.

Step 3: Start the Word with the use of CretaeDispatch

oWord.CreateDispatch("Word.Application")

Step 4: Do the GetDocuments() and Add the Document
oDocuments = oWord.GetDocuments();
oDoc = oDocuments.Add( vtOptional, vtOptional, vtOptional, vtOptional );

Step 5: Get the MailMerge interface using _Documents GetMailMerge() method.
oMailMerge = oDoc.GetMailMerge();

Step 6: Set the Document type as "mailing labels mail merge" then only you
will abke to Get the "Label Oprtions"Dialog

oMailMerge.SetMainDocumentType( 1L );

Step 7: Get the MallingLabel interface from the Application.
MailingLabel = oWord.GetMailingLabel();

Step 8: Call the "LabelOptions" method of the <ailling Label.
oMailingLabel.LabelOptions();

It will Pop Up the "Label OPtions" dialog

Step 9: To get the Sellected Label Format..
use the MaillingLables GetDefaultLabelName() method.

Best Regards..
-Thiru.
 

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