Reply
 
Thread Tools Display Modes
  #1   Report Post  
windowed
 
Posts: n/a
Default enter an excel module global variable value in a mailmerge letter

I'm working on a Word 2002 mail merge that's based on an Excel 2002
spreadsheet that's based on an underlying Acess97 DB. This is for a
quarterly billing letter to donors.

When the spreadsheet opens, a dialog box opens requesting information,
including numbers of houses billed this quarter and YTD. These are stored
in global variables in an excell VBA module (e.g., intNumHsBilldYTD).

In the letter, which has a complex if...then...else, I need to insert the
numbers in some but not all of the merged letters, depending on which
"if" condition is met. My question is, how do I reference it in the
mailmerge form to print the values in the letters?
  #2   Report Post  
Cindy M -WordMVP-
 
Posts: n/a
Default

Hi ?B?d2luZG93ZWQ=?=,

Mail merge can only pick up information in the data table, so the easiest
way would be to insert an additional column for each variable and enter the
value. Yes, I know, it would be the same entry for every record... but
perhaps you could pre-process the condition using VBA or a formula in that
Excel column. Then mail merge would be able to pick up the result, which
would be a lot faster, as far as mail merge is concerned.

Your only other possibility would involve automating Word to put this data
into the Word document. Probably as a document Variable (that's an object in
Word's OM), then use a DocVariable field in the If.

I'm working on a Word 2002 mail merge that's based on an Excel 2002
spreadsheet that's based on an underlying Acess97 DB. This is for a
quarterly billing letter to donors.

When the spreadsheet opens, a dialog box opens requesting information,
including numbers of houses billed this quarter and YTD. These are stored
in global variables in an excell VBA module (e.g., intNumHsBilldYTD).

In the letter, which has a complex if...then...else, I need to insert the
numbers in some but not all of the merged letters, depending on which
"if" condition is met. My question is, how do I reference it in the
mailmerge form to print the values in the letters?


Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
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 :-)

Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
inserting an Excel spreadsheet into Word - how to remove gridl Steve Tables 2 July 17th 07 06:30 AM
Difficulty pasting Excel data into Word table only in XP versions Digitonomy Tables 0 February 28th 05 12:33 AM
Mail Merge Issue With Office 97 - Excel Data Source Matt Thorley Mailmerge 1 February 15th 05 11:38 PM
Excel worksheet in Word linked text boxes Eduardo Oliveira Page Layout 0 January 5th 05 11:23 PM
Word Field Codes in Excel data file mranz Mailmerge 7 December 11th 04 09:02 AM


All times are GMT +1. The time now is 09:16 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"