Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
mehherc
 
Posts: n/a
Default need help with a macro

Ok, I cannot seem to figure this out or at least get it to work right. What I
am doing is trying to bring a list customers from an excel sheet and have
their lastname print on it with the proper salutation for them in a Word
document. In the excel sheet, the columns are labeled as lastname then
firstname then sex. When I use the mailmerge option, i get either the sex
and lastname(F Martinez) or firstname lastname (Emilia Martinez). I want it
to show Ms. Martinez.. I cannot do a substitutionon the Excel sheet. If I
could, the problem would have been solved along time ago. I am a little
frustrated by it. I have been working on it for 2 days now. I need the Word
document to read " Dear Ms. Martinez,".

Sorry for the whining. I am just aggravated at it now.
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP
 
Posts: n/a
Default need help with a macro

Use an If...then...Else... field

{ IF { MERGEFIELD sex } = "F" "Ms." Mr." }

The easiest way for you to do this is to insert that field for the Word
Fields pulldown. If you enter it directly from the keyboard, use Ctrl+F9 to
insert each pair of field delimiters { }


--
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

"mehherc" u19268@uwe wrote in message news:5ca9830e4a674@uwe...
Ok, I cannot seem to figure this out or at least get it to work right.
What I
am doing is trying to bring a list customers from an excel sheet and have
their lastname print on it with the proper salutation for them in a Word
document. In the excel sheet, the columns are labeled as lastname then
firstname then sex. When I use the mailmerge option, i get either the sex
and lastname(F Martinez) or firstname lastname (Emilia Martinez). I want
it
to show Ms. Martinez.. I cannot do a substitutionon the Excel sheet. If I
could, the problem would have been solved along time ago. I am a little
frustrated by it. I have been working on it for 2 days now. I need the
Word
document to read " Dear Ms. Martinez,".

Sorry for the whining. I am just aggravated at it now.



  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
mehherc via OfficeKB.com
 
Posts: n/a
Default need help with a macro

Ok, I must be showing my Blond, When I enter in IF { MERGEFIELD sex } = "F"
"Ms." Mr." , the text in word shows "MERGEFIELD". It might be working right,
but how do I tell WORD to go to that particular XLS sheet to match the "sex"
field?

--
Message posted via http://www.officekb.com
  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
mehherc via OfficeKB.com
 
Posts: n/a
Default need help with a macro

OK, never mind about how it gets the info from the excel sheet I figured that
out. But it still shows MERGEFIELD in the text, How do I change that so it
displays the Mr. or Ms.?

mehherc wrote:
Ok, I must be showing my Blond, When I enter in IF { MERGEFIELD sex } = "F"
"Ms." Mr." , the text in word shows "MERGEFIELD". It might be working right,
but how do I tell WORD to go to that particular XLS sheet to match the "sex"
field?


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...merge/200603/1
  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP
 
Posts: n/a
Default need help with a macro

I think that you must have omitted to read pr follow the last paragraph of
my post.

--
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

"mehherc via OfficeKB.com" u19268@uwe wrote in message
news:5cb563862f0ac@uwe...
OK, never mind about how it gets the info from the excel sheet I figured
that
out. But it still shows MERGEFIELD in the text, How do I change that so it
displays the Mr. or Ms.?

mehherc wrote:
Ok, I must be showing my Blond, When I enter in IF { MERGEFIELD sex } =
"F"
"Ms." Mr." , the text in word shows "MERGEFIELD". It might be working
right,
but how do I tell WORD to go to that particular XLS sheet to match the
"sex"
field?


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...merge/200603/1





  #6   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Charles Kenyon
 
Posts: n/a
Default need help with a macro

Download the gender toolbar from my website. You can use the fields in it to
build the merge fields you need. http://addbalance.com/word/download.htm

Simply replace the { DocVariable Gender } fields with your test mergefields.
My fields test for "male" and "female".
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://word.mvps.org/FAQs/ which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.


"mehherc" u19268@uwe wrote in message news:5ca9830e4a674@uwe...
Ok, I cannot seem to figure this out or at least get it to work right.
What I
am doing is trying to bring a list customers from an excel sheet and have
their lastname print on it with the proper salutation for them in a Word
document. In the excel sheet, the columns are labeled as lastname then
firstname then sex. When I use the mailmerge option, i get either the sex
and lastname(F Martinez) or firstname lastname (Emilia Martinez). I want
it
to show Ms. Martinez.. I cannot do a substitutionon the Excel sheet. If I
could, the problem would have been solved along time ago. I am a little
frustrated by it. I have been working on it for 2 days now. I need the
Word
document to read " Dear Ms. Martinez,".

Sorry for the whining. I am just aggravated at it now.



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
Macro Button Won't Stay on Toolbar caleb Microsoft Word Help 2 June 14th 05 11:59 PM
Possible bug when recording a Word Macro Raven95 Microsoft Word Help 4 April 30th 05 09:49 PM
Running document macro from server Intravler New Users 0 March 4th 05 04:33 AM
Save As is not working due to macro security settings Craig Meritz Microsoft Word Help 1 December 16th 04 03:53 AM
2000 to 2002 macro and "Could not open macro storage" Art Farrell Mailmerge 1 December 6th 04 12:40 PM


All times are GMT +1. The time now is 09:48 AM.

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"