List Info

Thread: Re: Mail merge between Access and Word - using VB-6




Re: Mail merge between Access and Word - using VB-6
country flaguser name
United States
2007-02-19 17:47:16
Hi Bruce

If you've read Prof. Smiley's books, you'll understand why I
want to 
do it this way.  He uses the Word objects in the object
library to 
print an invoice from inside the VB environment generated
app.  I 
wanted to enhance the invoice by customizing it using the
mail merge 
fields from the database.  In his objects book, he records a
Macro 
and converts it to VBA in Word 97 to generate the actual
document, 
then copies it into the VB-6 IDE and makes modifications to
generate 
the document from within the VB-IDE generated program.  I am
working 
on that, but wanted to personalize the document a little
more than 
the one generated in the Objects textbook.  His document
starts 
out "Dear SIR OR MADAM: This is to confirm your
order...", and in 
this version, he doesn't save  the order to the MDB file. 
In the 
Databases book (the fourth in the series) he doesn't do
anything with 
the objects from the third book. (I have his complete VB-6
series on 
a shelf right next to my computer.)

One more question:  DAO vs. ADO...I noticed that you keep
referencing 
DAO (the older database access technology, if I'm not
mistaken).  Can 
I still do DAO if I'm using Access 2002?  or would I have to
convert 
the database to a previous version?  (Access 2002 has the
capability 
to convert to Access 2k or Access 97).

Richard


--- In helpwithvb@yahoogroups.com, "Neiger, Bruce
D" 
<Bruce.D.Neiger...> wrote:
>
> lol -- that only makes things easier, once you make
sure things are 
up to date and consistent (MDAC installed, the right version
of DAO 
library, etc ) -- the Version of VBA in post Office 97 is
LOT more 
mature than those prior...
>  
> The concepts are the same though.  Say you have a
database with 
some data in it that you need.
> You want to retrieve the values during (A VB6) program
execution. 
> You can create a DAO database, and recordset objects,
following the 
examples in the database book, get the data, and use it.
>  
> You could also write the same (kind of) code in Word's
VBA, right 
in the document.  
> -=BDN=-
> ________________________________
> 
> From: helpwithvb@yahoogroups.com on behalf of Richard
> Sent: Mon 2/19/2007 4:59 PM
> To: helpwithvb@yahoogroups.com
> Subject: [helpwithvb] Re: Mail merge between Access and
Word - 
using VB-6
> 
> 
> 
> Hi Bruce.
> 
> Sorry, I forgot to mention that I am using Office XP
Pro 
components - 
> Word 2002 and Access 2002 - not office 97. Does that
change 
anything?
> 
> Richard




 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://grou
ps.yahoo.com/group/helpwithvb/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://
groups.yahoo.com/group/helpwithvb/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:helpwithvb-digest@yahoogroups.com 
    mailto:helpwithvb-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    helpwithvb-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.c
om/info/terms/
 

RE: Re: Mail merge between Access and Word - using VB-6
country flaguser name
United States
2007-02-19 22:29:57
I do recall, now
  Your thought is a good one.  Each of the LTP books tries
(and, imho succeeds) at imparting the concepts that it
focuses on.  Integrating the concepts from each of his books
would, of course yield a more complete application.  
 
So... is your question: "How do I take this extended
macro and store the order information in the database"
or "How do I use the mail merge functionality / fields
from VB6?" If the former, I (or many others) can help
guide you... I fear I don't know much about the part of
object model that deal with mail merge, however -- though
I'll wager someone on this list does.  I do know that you
can find the object model itself online on the msdn pages on
the ms site.
 
Storing the order data in a(n) .mdb file should just follow
the techniques you learn in the databases book.
 
DAO is, indeed the older technology -- that does NOT make it
obsolete.  It was optimized for Jet spaces (Access databases
-- Jet is the actual database management system part of
Access -- really, when you think of it, Access is
"just" the front end part... visual table creation
and querying tools,  table modeler, tools, reports, forms,
lotsa good stuff of course, but all bells and whistles
against he RDMBS itself, which is Jet). 
 
DAO works well (yes, currently) -- and I (will) continue to
use it when I code in VBA or VB6 against a Jet space. 
Occasionally I will find myself using ADO, these days, as in
when (rarely) I find myself coding in VB6  / VBA against an
SQL Server Express database, or other source.  But I have
been doing DAO so long that I hardly ever need to look up
any syntax anymore... So why quit?  Well, maybe Office 2007
or some later version will abandon DAO, and I will have to..
I hope not, though.
 
hth
-=BDN=-

________________________________

From: helpwithvb@yahoogroups.com on behalf of Richard
Sent: Mon 2/19/2007 5:47 PM
To: helpwithvb@yahoogroups.com
Subject: [helpwithvb] Re: Mail merge between Access and Word
- using VB-6



Hi Bruce

If you've read Prof. Smiley's books, you'll understand why I
want to 
do it this way. He uses the Word objects in the object
library to 
print an invoice from inside the VB environment generated
app. I 
wanted to enhance the invoice by customizing it using the
mail merge 
fields from the database. In his objects book, he records a
Macro 
and converts it to VBA in Word 97 to generate the actual
document, 
then copies it into the VB-6 IDE and makes modifications to
generate 
the document from within the VB-IDE generated program. I am
working 
on that, but wanted to personalize the document a little
more than 
the one generated in the Objects textbook. His document
starts 
out "Dear SIR OR MADAM: This is to confirm your
order...", and in 
this version, he doesn't save the order to the MDB file. In
the 
Databases book (the fourth in the series) he doesn't do
anything with 
the objects from the third book. (I have his complete VB-6
series on 
a shelf right next to my computer.)

One more question: DAO vs. ADO...I noticed that you keep
referencing 
DAO (the older database access technology, if I'm not
mistaken). Can 
I still do DAO if I'm using Access 2002? or would I have to
convert 
the database to a previous version? (Access 2002 has the
capability 
to convert to Access 2k or Access 97).

Richard

--- In helpwithvb@yahoogroups.com
<mailto:helpwithvb%40yahoogroups.com> , "Neiger,
Bruce D" 
<Bruce.D.Neiger...> wrote:
>
> lol -- that only makes things easier, once you make
sure things are 
up to date and consistent (MDAC installed, the right version
of DAO 
library, etc ) -- the Version of VBA in post Office 97 is
LOT more 
mature than those prior...
> 
> The concepts are the same though. Say you have a
database with 
some data in it that you need.
> You want to retrieve the values during (A VB6) program
execution. 
> You can create a DAO database, and recordset objects,
following the 
examples in the database book, get the data, and use it.
> 
> You could also write the same (kind of) code in Word's
VBA, right 
in the document. 
> -=BDN=-
> ________________________________
> 
> From: helpwithvb@yahoogroups.com
<mailto:helpwithvb%40yahoogroups.com>  on behalf of
Richard
> Sent: Mon 2/19/2007 4:59 PM
> To: helpwithvb@yahoogroups.com
<mailto:helpwithvb%40yahoogroups.com> 
> Subject: [helpwithvb] Re: Mail merge between Access and
Word - 
using VB-6
> 
> 
> 
> Hi Bruce.
> 
> Sorry, I forgot to mention that I am using Office XP
Pro 
components - 
> Word 2002 and Access 2002 - not office 97. Does that
change 
anything?
> 
> Richard



 


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://grou
ps.yahoo.com/group/helpwithvb/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://
groups.yahoo.com/group/helpwithvb/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:helpwithvb-digest@yahoogroups.com 
    mailto:helpwithvb-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    helpwithvb-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.c
om/info/terms/
 

  
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )