View Single Post
  #18  
Old February 24th, 2009, 08:55 AM posted to microsoft.public.word.tables
Graham Mayor
external usenet poster
 
Posts: 18,297
Default formatting dates

What does {Mergefield CellA1} without the switch produce? If it does not
produce a 10 digit number :-
From the Tools menu in Word, select Options and then go to the General tab
and check the box against the "Confirm conversions at open" item. (In Word
2007 it is Office Button Word Options Advanced General Confirm file
format conversion on open). Then when you attach the data source to the mail
merge main document, you will be given the option of using the DDE method of
connection which should read the data as you have it formatted in the table.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Wiersma7 wrote:
Yay! "Birthday:" disappears when I want it to Thanks for your help
- and patience.

As for formatting the Cell number, I get a return of (-000) 000-8763.

After I ctrl f9 I typed, from what I can tell, exactly how you have it
below: {Mergefield CellA1 \# "(000) 000'-'0000" }. I don't see
anything on your website (or MS's) that tells me what I'm doing wrong
or ...whatever. Can you help me out one last time?





"Graham Mayor" wrote in message
...
Actually no! \@ is for date and time formats. You need
{Mergefield CellA1 \# "(000) 000'-'0000" }
See http://www.gmayor.com/formatting_word_fields.htm which explains
most of what you will ever need to know about switches.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Wiersma7 wrote:
Okay will try again I think I only did the first bracket.

I know I'm being a pain in the neck about this...by the same token I
need to insert a phone number with the format:
(###) ###-####. What characters do I use for this?
I assume I do it the same way as formating a date...?
{Mergefield CellA1 \@ "(___) ___-____"}

Thanks again,
wiersma7




"Suzanne S. Barnhill" wrote in message
...
You do have to press Ctrl+F9 for *every* pair of field braces.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org

"Wiersma7" wrote in message
...
Sorry, I've been on vacation (yay me)

Yes, I think I did. First I pressed Ctrl+F9, then typed in the
rest. I know I'm missing something here, but I can't see what it
is. I know I'm being a pain in the neck about this...by the same token
I need to insert a phone number with the format:
(###) ###-####. What characters do I use for this? I assume I do
it the same way as formating a date...?
{Mergefield CellA1 \@ "(___) ___-____"}

You guys have been so great! Thanks,
wiersma7




"Suzanne S. Barnhill" wrote in message
...
You did insert {Mergefield BdayK1} and the rest using Ctrl+F9 or
Insert Merge Field?

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org

"wiersma7" wrote in message
...
The equation makes sense to me, but when I put it in the Column
2 cell the return is the equation. Am I missing something on
how to place this?
I'm new at doing this in Word (not Excel) so I'm wondering if
there's a step I'm not aware of. I put the exact equation in,
except changed the fields to match my fields (BdayA1, BdayA2,
BdayK1, etc.) so for instance:

Column 1 Column 2 Column 3

«Kid1» {IF {Mergefield BdayK1} "" "Birthdate: "}
«BdayK1» «Adult1» {IF {Mergefield BdayA1} ""
"Birthdate: "} «BdayA1» «Adult2» {IF {Mergefield BdayA2}
"" "Birthdate: "} «BdayA2» «Kid1» {IF {Mergefield
BdayK1} "" "Birthdate: "} «BdayK1» «Kid2» {IF
{Mergefield BdayK2} "" "Birthdate: "} «BdayK2» «Kid3» {IF
{Mergefield BdayK3} "" "Birthdate: "} «BdayK3» «Kid4» {IF
{Mergefield BdayK4} "" "Birthdate: "} «BdayK4» «Kid5» {IF
{Mergefield BdayK5} "" "Birthdate: "} «BdayK5» «Kid6» {IF
{Mergefield BdayK6} "" "Birthdate: "} «BdayK6» «Kid7» {IF
{Mergefield BdayK7} "" "Birthdate: "} «BdayK7» This is
what merges:

*George {IF {Mergefield BdayA1} ""
"Birthdate: "} September 24
Martha {IF {Mergefield BdayA2} ""
"Birthdate: "} June 05
Christopher {IF {Mergefield BdayK1} ""
"Birthdate: "} June 02
Daniel {IF {Mergefield BdayK2} ""
"Birthdate: "} March 07
Jesse {IF {Mergefield BdayK3} ""
"Birthdate: "} March 07 (twins)
{IF {Mergefield BdayK4} ""
"Birthdate: "}
{IF {Mergefield BdayK5} ""
"Birthdate: "}
{IF {Mergefield BdayK6} ""
"Birthdate: "}
{IF {Mergefield BdayK7} ""
"Birthdate: "}

*names are changed to protect the innocent

Wiersma7



"Graham Mayor" wrote in message
...
You haven't said how you know whether the adults want their
birthdate withheld, but essentially that second column should
have a series of conditional fields. The following will insert
the text Birthdate : in the second column when the birthday
field is not empty. Obviously nothing is printed in columns one
or two when the fields in them are empty.

Column 2
{IF {Mergefield Adult1Bday} "" "Birthdate: "}
{IF {Mergefield Adult2Bday} "" "Birthdate: "}
{IF {Mergefield Kid1Bday} "" "Birthdate: "}
{IF {Mergefield Kid2Bday} "" "Birthdate: "}
{IF {Mergefield Kid3Bday} "" "Birthdate: "}
{IF {Mergefield Kid4Bday} "" "Birthdate: "}
{IF {Mergefield Kid5Bday} "" "Birthdate: "}
{IF {Mergefield Kid6Bday} "" "Birthdate: "}
{IF {Mergefield Kid7Bday} "" "Birthdate: "}

If however you have a second field that logs whether the adult
birthdays, though present in the data, are to be withheld then
you need for the first two rows in

Column 2
{ IF{ Mergefield Adult1Bday } "" "{ IF{ Mergefield
Adult1HideBday } = " " "Birthdate: " "" }" ""}
{ IF{ Mergefield Adult2Bday } "" "{ IF{ Mergefield
Adult2HideBday } = " " "Birthdate: " "" }" ""}

Column 3
{ IF{ Mergefield Adult1HideBday } " " "{ Mergefield
Adult1Bday }" }
{ IF{ Mergefield Adult2HideBday } " " "{ Mergefield
Adult2Bday }" }

All fieldnames should reflect the actual field names. The {
Mergefield Adult1HideBday } and { Mergefield Adult2HideBday }
are expected to have no content when the adult does not mind
the birthdate being shown - change the condition as
appropriate. Spaces and quotes are as shown. The bracket pairs
{} are all placed with CTRL+F9 --

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Wiersma7 wrote:
Actually I want to do this with a non merged cell content. I
have 'Kid1' as a merged field all the way through 'Kid7". That
is the largest number of children in a family of the church.
Most families, however, have 1 - 4 children. I need to have
the label 'Birthday:' before each birth date of each child
(as well as the adults). What I want to happen is:
1. If I have no data or the adult does not want his/her
birthdate published, I do not want the label 'Birthdate:' to
appear before an empty cell/field.

2. I do not want the label 'Birthdate:' to appear when
there is no child name/birthday field info.

For instance: my table has 3 columns:
John Birthdate: January 1
Sally Birthdate: February 1
Kid3 Birthdate:
Kid4 Birthdate:
Kid5 Birthdate:
Kid6 Birthdate:
Kid7 Birthdate:

The Kid3 - 7 fields will be blank because they only have 2
kids. The Birthday fields will be blank for same reason. The
text/label 'Birthdate:' however is static. I need the
label/text to disappear. I tried putting { IF { MERGEFIELD
BdaykK3 } = "" ""} in the
'Birthdate:' cell, but all I get is MERGEFIELD.

Is this a possibility or am I going to have to do it manually?
(really need a database, I know - but not in budget right
now). Thanks for even taking the time to figure out what I
just typed wiersma7


"Suzanne S. Barnhill" wrote in message
...
Yes, you need an IF field for this. Although Word makes it
relatively easy to insert IF fields in merge documents (using
the Insert Word Field button), it makes it quite difficult to
actually insert merge fields in them, so it's usually easier
to create them from scratch. 1. Press Ctrl+F9 to insert a
field, which will be represented by two
braces around two spaces, with the insertion point in the
center. 2. Between the braces type IF, then use the keyboard
and the
Insert Merge Field button to create the following field:

{ IF { MERGEFIELD BdayA1 } = "" "" "{ MERGEFIELD BdayA1
}" } Alternatively, you can use:

{ IF { MERGEFIELD BdayA1 } "" "{ MERGEFIELD BdayA1 }" }

The first tells Word, if the data field is blank, to insert
nothing, otherwise to insert the merge data. The second tells
Word to insert the merge data if the data field is not blank.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org

"Wiersma7" wrote in message
...
Yay! It makes sense now. Thanks so much!

Also, is there way to have a conditional rule (?) to only
print the text: 'Birthday:' if there is a date in the date
field? Below is the simple table (obviously I'm making a
directory -
for my
church):

«Adult1»
Birthday:
«BdayA1»

Cell:
«CellA1»

Email:
«EmailA1»

Anniversary:
«Anniversary»






Thanks so much for all of your help!
wiersma7


"Suzanne S. Barnhill" wrote in message
...
You press Alt+F9 to display the field code of your merge
field (such as «BdayA1», which will show { MERGEFIELD
BdayA1 }) and add the switch to that field.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org

"Wiersma7" wrote in message
...
The table has merge fields from an Excel spreadsheet. I
understand the premise of what the [below address: http:
//www.gmayor.com/formatting_word_fields.htm] is about -
but I'm not sure how to incorporate that into my table.
Do I add the switch as a field to the spreadsheet? To the
table? That doesn't seem to work. I guess I'm asking if
you can simplify it for me. I would like to change the
format of 01/01/09 to January 1. (btw - I do know how to
do it in Excel ) Also, is there way to have a conditional
rule
(?) to only
print the text: 'Birthday:' if there is a date in the date
field? Below is the simple table (obviously I'm making a
directory - for my church):

«Adult1»
Birthday:
«BdayA1»

Cell:
«CellA1»

Email:
«EmailA1»

Anniversary:
«Anniversary»





Thanks very much for your help so far,
wiersma7


"Suzanne S. Barnhill" wrote in
message ...
If the table was created via a mail merge, you can add a
numeric picture switch to the merge field to constrain
the display (see
http://www.gmayor.com/formatting_word_fields.htm).
Alternatively, you can link to Excel using DDE instead of
OLE DB, which will preserve the native Excel formatting.
-- Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org

"Wiersma7" wrote in message
...
I have a table that has birthday dates. The info in the
table was imported from Excel with the dates formatted
as 'mmmm dd'. However, they imported as I entered them:
mm/dd/yy. I don't want the years to show. How can I
format these dates in my table to reflect only the Birth
Date? (rather than going through each record) Thanks,
wiersma7



Ads