Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Word
application.errors
conversions
docmanagement
drawing.graphics
formatting.longdocs
international
internet.assistant
mail
mailmerge.fields
menustoolbars
newusers
numbering
oleinterop
pagelayout
printingfonts
setup.networking
spelling.grammar
tables
vba.addins
vba.beginners
vba.customization
vba.general
vba.userforms
web.authoring
word6-7macros
word97vba
  
 
date: Sun, 28 Sep 2008 14:56:29 -0700,    group: microsoft.public.word.vba.general        back       


Docproperty Docvariable or Mail Merge   
If I wish to automate a word document (2003) and take data from an access 
database via vba, When is the correct time to use a docproperty or a 
docvariable or a mergefield switch in the word doc?
Which one is best for what purpose?
The doc will be used for autoquotes with fileds filled in via a database an 
be automated via access.
Thanks advance 
Bill
date: Sun, 28 Sep 2008 14:56:29 -0700   author:   Bill

Re: Docproperty Docvariable or Mail Merge   
Mergefields will work quite well under most circumstances, but cannot handle 
the sort of situation where you need to create invoices for multiple 
addressees where for each addressee there are multiple items to be included 
on the one invoice.

In those circumstances I would use a roll-your-own equivalent to mailmerge 
that used a template containing Docvariable fields in place of merge fields 
and use code to iterate through the data source, creating a new document 
from the template for each addressee and populating the variables with the 
data for that addressee and builds a table in the document to contain the 
invoice items for that addressee.

Otherwise, as you are wanting to automate this from Access, I suggest that 
you take a look at the information referred to in the following post from 
fellow MVP, Albert Kallal.

Quote

Actually, use my merge sample. it don't give that warning, and you don't
have to change registiry stuff etc.

The sample I have can be found here:
http://www.members.shaw.ca/AlbertKallal/msaccess/msaccess.html

What is nice/interesting about my sample is that is specially designed to
enable ANY form with ONE LINE of code....

Thus, each time you build a new form, you can word merge enable it with
great ease.

Make sure you read the instructions from above, and you should eventually
get to the follwoing page
http://www.members.shaw.ca/AlbertKallal/wordmerge/page2.html


Note that the merge can also use a query, and thus you don't have to merge
just "one" record..

After the merge occurs, you get a plain document WITHOUT any merge fields,
and this allows the end user to save, edit, or even email the document
(since the merge fields are gone after the merge occurs).

Give the above a try.

Albert D. Kallal    (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal@msn.com
Unquote

-- 
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Bill"  wrote in message 
news:06F92F6C-3687-4EAC-8418-96940BED7F9F@microsoft.com...
> If I wish to automate a word document (2003) and take data from an access
> database via vba, When is the correct time to use a docproperty or a
> docvariable or a mergefield switch in the word doc?
> Which one is best for what purpose?
> The doc will be used for autoquotes with fileds filled in via a database 
> an
> be automated via access.
> Thanks advance
> Bill
>
>
date: Mon, 29 Sep 2008 11:14:37 +1000   author:   Doug Robbins - Word MVP

Re: Docproperty Docvariable or Mail Merge   
Dear Doug,
Thankyou for the advice and information.
Best Regards
Bill

"Doug Robbins - Word MVP" wrote:

> Mergefields will work quite well under most circumstances, but cannot handle 
> the sort of situation where you need to create invoices for multiple 
> addressees where for each addressee there are multiple items to be included 
> on the one invoice.
> 
> In those circumstances I would use a roll-your-own equivalent to mailmerge 
> that used a template containing Docvariable fields in place of merge fields 
> and use code to iterate through the data source, creating a new document 
> from the template for each addressee and populating the variables with the 
> data for that addressee and builds a table in the document to contain the 
> invoice items for that addressee.
> 
> Otherwise, as you are wanting to automate this from Access, I suggest that 
> you take a look at the information referred to in the following post from 
> fellow MVP, Albert Kallal.
> 
> Quote
> 
> Actually, use my merge sample. it don't give that warning, and you don't
> have to change registiry stuff etc.
> 
> The sample I have can be found here:
> http://www.members.shaw.ca/AlbertKallal/msaccess/msaccess.html
> 
> What is nice/interesting about my sample is that is specially designed to
> enable ANY form with ONE LINE of code....
> 
> Thus, each time you build a new form, you can word merge enable it with
> great ease.
> 
> Make sure you read the instructions from above, and you should eventually
> get to the follwoing page
> http://www.members.shaw.ca/AlbertKallal/wordmerge/page2.html
> 
> 
> Note that the merge can also use a query, and thus you don't have to merge
> just "one" record..
> 
> After the merge occurs, you get a plain document WITHOUT any merge fields,
> and this allows the end user to save, edit, or even email the document
> (since the merge fields are gone after the merge occurs).
> 
> Give the above a try.
> 
> Albert D. Kallal    (Access MVP)
> Edmonton, Alberta Canada
> pleaseNOOSpamKallal@msn.com
> Unquote
> 
> -- 
> Hope this helps.
> 
> Please reply to the newsgroup unless you wish to avail yourself of my
> services on a paid consulting basis.
> 
> Doug Robbins - Word MVP
> 
> "Bill"  wrote in message 
> news:06F92F6C-3687-4EAC-8418-96940BED7F9F@microsoft.com...
> > If I wish to automate a word document (2003) and take data from an access
> > database via vba, When is the correct time to use a docproperty or a
> > docvariable or a mergefield switch in the word doc?
> > Which one is best for what purpose?
> > The doc will be used for autoquotes with fileds filled in via a database 
> > an
> > be automated via access.
> > Thanks advance
> > Bill
> >
> > 
> 
> 
>
date: Sun, 28 Sep 2008 18:42:02 -0700   author:   Bill

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us