"thank you note" button

M

Matt Edwards

I have an Access database that tracks 2500 "potential
donors" using forms. Each form has several subforms,
including one for "donations received."

I'd like to create a button that prints out a thank you
note from a Word doc, filling in variable information
like "name" and "amount received" where appropriate for
people one at a time (which excludes using mail merging as
I know it).

Help!

-ME
 
G

Guest

Why not just make a report from a query with your requirements, ie name, amount received, etc. Does it have to be in Word? The thank you note should look just as good in a Report. If you want it in Word, you'll have to do some programming with TransferText Action to export the Report to Word

----- Matt Edwards wrote: ----

I have an Access database that tracks 2500 "potential
donors" using forms. Each form has several subforms,
including one for "donations received.

I'd like to create a button that prints out a thank you
note from a Word doc, filling in variable information
like "name" and "amount received" where appropriate for
people one at a time (which excludes using mail merging as
I know it).

Help

-M
 
D

Dirk Goldgar

Matt Edwards said:
I have an Access database that tracks 2500 "potential
donors" using forms. Each form has several subforms,
including one for "donations received."

I'd like to create a button that prints out a thank you
note from a Word doc, filling in variable information
like "name" and "amount received" where appropriate for
people one at a time (which excludes using mail merging as
I know it).

If you intend to print this out, I don't see what's wrong with setting
it up as an Access report instead of a Word document, and using the
WhereCondition argument when printing it from code to limit it to the
individual you want. However, if you really want to do it in Word, you
can have code that creates and automates an instance of the Word
application, creates a document based on your template for the thank-you
note, stuffs the variable information into named bookmarks that were
defined in the template, and prints out the document.
 
G

gandalf

We use bookmarked word documents.
You will need a reference to Word

Dim m_objWord As Word.Application
Dim m_objDocument As Word.Document
Dim bCheckGrammarAsYouType As Boolean
Dim bCheckGrammarWithSpelling As Boolean
Dim bCheckSpellingAsYouType As Boolean
dim rRs as dao.recorset


Set m_objWord = New Word.Application

bCheckGrammarAsYouType =
m_objWord.Options.CheckGrammarAsYouType
bCheckGrammarWithSpelling =
m_objWord.Options.CheckGrammarWithSpelling
bCheckSpellingAsYouType =
m_objWord.Options.CheckSpellingAsYouType
bCheckGrammarAsYouType =
m_objWord.Options.CheckGrammarAsYouType
bCheckGrammarWithSpelling =
m_objWord.Options.CheckGrammarWithSpelling
bCheckSpellingAsYouType =
m_objWord.Options.CheckSpellingAsYouType
'disable grammar checking
m_objWord.Options.CheckGrammarAsYouType = False
m_objWord.Options.CheckGrammarWithSpelling = False
m_objWord.Options.CheckSpellingAsYouType = False

Set m_objDocument = m_objWord.Documents.Add(sMydocument)
set rRs=....'source of info

m_objDocument.Bookmarks("Donation").Range.Text = Nz
(rrs.Fields("Donation"))
....
m_objDocument.PrintOut Background:=False
m_objDocument.CLOSE SaveChanges:=wdDoNotSaveChanges

'resture grammatica-en spellingscontrole
m_objWord.Options.CheckGrammarAsYouType =
bCheckGrammarAsYouType
m_objWord.Options.CheckGrammarWithSpelling =
bCheckGrammarWithSpelling
m_objWord.Options.CheckSpellingAsYouType =
bCheckSpellingAsYouType
m_objWord.Quit 'Word afsluiten

Set m_objDocument = Nothing
Set m_objWord = Nothing

Hope this helps.
-----Original Message-----
Why not just make a report from a query with your
requirements, ie name, amount received, etc. Does it have
to be in Word? The thank you note should look just as
good in a Report. If you want it in Word, you'll have to
do some programming with TransferText Action to export the
Report to Word.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top