Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / June 2005

Tip: Looking for answers? Try searching our database.

VB6 and Word question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Robert - 02 Jun 2005 18:09 GMT
Hi,

I need some hints for the following problem.

I have a VB 6 application that needs to write data (text and image) to a
Ms-Word document (template)

So I created a Ms-Word document with some bookmarks. The VB App is able to
write the data to the Ms-Word document and save it with a new doc-name.
But.this works only for one page. How to deal with a multiple page document.

So the user of my application can create his/her own Word document
(template) and can choose every lay-out they wish as long as they insert the
obligatory fields.
My application uses this Word document (template), fills in the fields and
saves it with a new documentname.
But beforehand it's unknown how much pages the application needs. The
Microsoft Word document (template) contains only one page with the
obligatory fields.
So if the fields are filled, how to create the next page with the same
lay-out, .... read obligatory fields.

Is mail merge an option, and if so how to create such a Ms-Word document.

I hope you understand what i intend. My excuses but English is not my native
language.

Robert
Peter Jamieson - 03 Jun 2005 10:13 GMT
I think your main choices are:
a. do not use mail merge. Always start from the initial document, then for
each record in your data source
 - copy/paste the initial document into an intermediate document
 - insert your data and pictures into the intermediate document
 - copy the intermediate document and append it to the output document
 - clear or delte the intermediate document
b. use mail merge.
 - create a new data source from the data in your VB6 program
 - use OpenDataSource to connect the initial document to that data source
 - perform the merge
 - do any necessary postprocessing on the output document (which is the
ActiveDocument after the merge.

Before you use (b), you need to check that mailmerge is a viable process for
producing the kind of documents you want from the inputs you have. For
example, Mailmerge is not designed to process Parent/child tables to produce
things such as "one invoice with detail lines per customer". If you write
your own merge function, you may get a lot more control, but you have to do
a lot more work, e.g.
 - decide how users should define where data should go in their documents
 - validate that user markup
 - do all the data insertion
 - consider what to do about stuff such as headers/footers, other types of
field codes the users might enter (at what point should they be
executed/resolved)

Peter Jamieson
 -
> Hi,
>
[quoted text clipped - 27 lines]
>
> Robert
Robert - 04 Jun 2005 18:52 GMT
What about using AutoText. Create a new page after the last line and insert
AutoText (AutoText contains the whole page with bookmarks) ?

Robert
Peter Jamieson - 04 Jun 2005 22:32 GMT
Can do - jut make sure you clean up and don't leave the user with questions
to do with saving templates.

Peter Jamieson
> What about using AutoText. Create a new page after the last line and
> insert
> AutoText (AutoText contains the whole page with bookmarks) ?
>
> Robert
Robert - 06 Jun 2005 19:20 GMT
Thanks Peter.

>I think your main choices are:
> a. do not use mail merge. Always start from the initial document, then for
[quoted text clipped - 58 lines]
>>
>> Robert

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.