Complex Merge Questions (coming from WordPerfect)

L

Lorane

Hi - this is my first post to this group. I have been an expert
WordPerfect user for many years. But now I need to learn Word,
particularly the merge and macro functions. So here I am asking for
help!

I'm converting my oh-so-complex WP docs over to Word. I'm trying to
figure out how to do this in Word and hopefully, someone can guide me
through it:

In the most simple way I can explain it, I want to ask the user: "Do
you want to insert sentence 1, 2 or 3". They will respond 1, 2, or 3
(actually it's in letters, but easier to talk numbers here). If they
choose 1, then I want to insert Sentence 1 into the merge. Sentence 1
will have merge fields in it. Same for sentences 2 and 3.

Ideas on how to do this??

Thanks,

Lorane
 
D

Doug Robbins - Word MVP

Hi Lorane,

I think you might really be better off to have a userform into which the
user could insert the relevant numbers/answers and then have the code behind
the form delete the unwanted paragraphs from the template which would have
all of the paragraphs in it to begin with

See the article "How to create a Userform" at:

http://www.mvps.org/word/FAQs/Userforms/CreateAUserForm.htm

You can however use a { FILLIN } field inside an { IF } field such as the
following

{ IF { FILLIN "Enter a Number" } = 1 "The user entered 1" "The user did not
enter 1" }

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
C

Cindy Meister -WordMVP-

Hi Lorane,
I have been an expert
WordPerfect user for many years. But now I need to learn Word,
particularly the merge and macro functions. So here I am asking for
help!
I imagine we may be seeing a lot of you :) My sympathy, and I hope the
task won't be TOO painful. I remember when I migrated - but that was
over ten years ago!

Note that for mail merge it is VERY important that you mention WHICH
version of Word is involved. It's important for other questions, too,
but replies can get really vague for mail merge...
In the most simple way I can explain it, I want to ask the user: "Do
you want to insert sentence 1, 2 or 3". They will respond 1, 2, or 3
(actually it's in letters, but easier to talk numbers here). If they
choose 1, then I want to insert Sentence 1 into the merge. Sentence 1
will have merge fields in it. Same for sentences 2 and 3.
Doug Robbins made a couple of suggestions, but he didn't ask: are you
merging more than one record from the data source? And if you are, does
the answer apply to ALL records, or must it be asked for each one?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jan 24 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :)
 
L

Lorane

Cindy -

I'm using Word 2002 for the merge. The merge is initiated from my
practice management software (we're in the health field). It passes
all the MANY fields of information over to Word to merge. They must
use some VBA code to pass the info and run the merge. The database is
in SQL.

Right now, it's doing one patient(record) at a time, but I would like
to figure out how to do many patients at a time.

How would a Userform work with an *ongoing* merge? I think I got
around this issue by grouping a bunch of IF X = 1 "typed text", IF X =
2 "some other typed text."

Here's another merge question: Can I "nest" a macro to run after the
merge quits? I tried INSERT MACRO button, but when the merge ran, all
I got at the end was: {MACROBUTTON delsemis} - how to make it run
automatically?

Thank you all for your kind help,

Lorane
 
D

Doug Robbins - Word MVP

Hi Lorane,

Re the userform part of your response, if you had the mailmerge main
"document" saved as a template with an autonew macro in it to call the
userform, when you created a new document from that template, the userform
would be displayed enabling you to make the necessary selections. You would
then end up with a mailmerge main document that contained the required text,
ready for the merge operation to be executed.

In the practice management software, are you able to specify what is used as
the mailmerge main document?

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
C

Cindy Meister -WordMVP-

Hi Lorane,

See Doug's answer on the question of UserForms. No need for us to
duplicate effort :)
Here's another merge question: Can I "nest" a macro to run after the
merge quits? I tried INSERT MACRO button, but when the merge ran, all
I got at the end was: {MACROBUTTON delsemis} - how to make it run
automatically?
You could create a macro that would 1) execute the merge, then 2)
perform any desired actions on the result. This would work with any
version of Word.

With Word2002 you also have MailMergeEvents that will let you pretty
much duplicate what WordPerfect could do. Setting them up isn't as
simple as in WP, but the end effect is similar. There are four events,
but the first one is practically useless since it only fires if the
mail merge is executed from the task pane:
MailMergeBeforeMerge
MailMergeBeforeRECORDmerge
MailMeregeAfterRecordMerge
MailMergeAfterMerge

You'll find some sample code for this in the article about new
functionality in Word 2002 on the msdn website. (On Microsoft.com).
Search on my name, and you should turn it up :)

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jan 24 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :)
 
L

Lorane

Doug - thanks for your response.

My practice management software ties up Word with its own .dot file
and must be running a background VBA to get the automation it needs.
When we merge a letter, edit it and print it, it will be saved in our
practice management software as a PDF file so we can look back at the
correspondence history we have sent to one particular patient. That
part is quite neat. Unfortunately, I am such a novice that I haven't a
clue how that is being done.

That said, I really don't have much control pre-merge over this thing.
If I get "brave and stupid" enough I might try that you said about
using an autonew macro, but I'm nowhere near that yet!

I've gone through and IF'd this merge to the max and then I'll
probably have to hand run a macro to fix a few formatting problems
(unless you can tell me how to AUTORUN a merge at the END of the merge
.. . . ) and then I need to insert two jpg files. I'd really like to be
able to automatic inserting the jpg files and I've another thread
going to see if I can get some help on that one.

Guys, I really have to tell you that WP beats Word hands down in
running complex merges, but you probably already know that!

Thanks,

Lorane
 

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