
From VB6, call a MS WORD Mail-Merge feature
Thank you Astrid. But I need more help.
From VB, trying to access WORD, using Object Browser (F2),
I get tons of classes for the WORD object. Which one do I
choose? Assuming I choose Application. My VB code:
Dim MyWordAppObj As Word.Application
Set MyWordAppObj = CreateObject("Word.Application")
or do I do this:
Dim MyWordMergeObj As Word.MailMerge
or this:
Dim MyWordDocObj As Word.Document
Than after I dim the object and set it, what next?
Each object has it's own bunch of properties and methods.
I tried:
MyWordDocObj.FullName
"C:\DATA\Palletized\PalletSegmentSheets.doc"
VB did'nt like that. I'm trying to tell VB which document
I am trying to work with. How do we do this?
Can anyone give me some sample code please? Thank you.
Quote:
>-----Original Message-----
>Hi Lino,
>This can be done from within VB, try:
> oDoc.MailMerge.State = wdNormalDocument
>where oDoc is the objectvariable that holds the Word
document.
>For more info on automating Word, see
>http://www.mvps.org/word/FAQs/InterDev/index.html
>Hope this helps,
>regards,
>Astrid
>So that all can benefit from the discussion, please post
all follow-ups to the newsgroup.
Quote:
>Visit the MVP Word FAQ site at http://www.mvps.org/word/
Quote:
>> Hi,
>> I have a MS Word document that is a 'mail merge main
>> document'. From within WORD, I can restore this
document
>> by choosing: Tools/Mail Merge/Main Document/Create
>> then choose: "Restore to Normal Word Document"
>> This detaches this document from the data source, but
most
>> importantly, keeps the existing data on the document.
>> Now for my question: I would like to do this same
thing
>> to this word doc, from a VB6 application. DOes anyone
>> know if this is possible? Can anyone refer me to any
>> documentation anywhere on this? Do I use VBA?
>> Thank you. Lino Vlacic, New York
>.