Hi Horndog,
> I have a client who is using a MySQL database and the front end is
> written in Visual Basic 6. What the client would like is a document
[quoted text clipped - 6 lines]
> Now, the tricky part is that it wants it to be called via a field
> called: "Return Date"
"It wants to be called..." isn't quite clear. What is "it", and what
should be calling it? Do you mean the data needs to be filtered by
certain values in the Return Date field?
You can certainly set up an application as you describe below. I'd say,
if the interface is already in VB6, then it might make sense to stick
with VB6. But you could also put it in a Word template.
Whether the entire filtering can be done using Word's interface will
depend on how long the SQL Statement might be that you need to use. You
mention that the data source should remain attached to the template at
all times. This means a limit of 255 characters for the SQL Statement
(QueryString property)
That raises the question whether the template should be connected to a
query in the data source and you use code to change that query's
definition. (I don't know whether you can do that with MySQL; it would
be possible with Access or SQL Server.)
The code can also set up the document. Postcards are usually just a
special type of label (different grid size). There's a Knowledge Base
article written for VB on how to create labels for mail merge that will
give you the basic syntax for creating a label sheet. I don't really
recommend the other sample code it contains...
an alternate approach, since you'll be using a template, would be to
save the table grids that make up the two types of merge document as
AutoText entries, including all the necessary merge fields. Then all
your code would need to do is insert the appropriate AutoText.
> 1. Take a query and the user will be able to insert(user define via a
> form) a date range for the mail merge(if possible).
[quoted text clipped - 9 lines]
>
> What methods should be used?
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.word.mvps.org
This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :-)
anyone know if this can be done
Cindy M -WordMVP- - 28 Jan 2004 17:31 GMT
Hi Horndog,
> anyone know if this can be done?
Did you see my response?
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update
Sep 30 2003)
http://www.word.mvps.org
This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:-)
horndog - 29 Jan 2004 18:11 GMT
yes, thank you for the response. I am looking at functionality and
stability to do this.
So you say that I could just do the query at the application level and
have the output to a Word template with datafields on the Word
template?
Was this KB article on MSDN's website?
Thanks
------------------------------------------------
horndog - 29 Jan 2004 22:19 GMT
I did some searching and finally found some useful articles with
Microsoft.. Microsoft's website is a pain in the you know where.
Anyways, I like the idea of automating it from the application itself
and can just pull data and dump it into word. I found about 4 articles
with code snippets.
I will have to create two new forms in the VB application and do the
merges. One form will do the date range and the other will do the zip
codes.
Thanks for the pointing, I guess its time to go write some code and see
all the pretty code colors!
------------------------------------------------
Cindy M -WordMVP- - 02 Feb 2004 16:09 GMT
Hi Horndog,
> I guess its time to go write some code and see
> all the pretty code colors!
<G> Have fun! Do come back if you run into any snags along
the way. Or, if your questions are more generally about how
to automate Word and less about mail merge, one of the
word.vba groups would probably be better.
Cindy Meister