Superscript does not stay after merging

R

Richard

I am using MS Word 2002 SP3 to merge data.

However, none of the superscripting formatting moves from the data field to
the merged documents.

For example if I have a field with 12th day of April 2004, the "th" would be
superscripted in the data field.

When I merge the data the "th" would not be superscripted in the merged
document, it would be just a regular "th". (It still is superscripted in
the data file) All other superscripts that I have manually entered into the
merged document stays superscripted. Even after I have corrected the
superscripting, if I close the document and re-enter, I must correct all of
the superscripts in the merged fields.

Please let me know how I can keep the superscripts "up high" after a merge.

Yours truly,

Richard
 
M

macropod

Hi Richard,

If you can re-format your data source to hold the dates in a simple
dd/MM/yyyy format, the following mergefield code should achieve what you're
after:

{QUOTE{SET Data{MERGEFIELD MergeDate}}{Data \@ d}{IF{=(mod({Data \@
d},10)<4)*(mod({Data \@ d},10)<>0)*({Data \@ d}<>11)*({Data \@
d}<>12)*({Data \@ d}<>13)}= 1 {=mod({Data \@ d},10)-2 \# rd;st;nd} th}" of
"{Data \@ "MMMM yyyy"}}

The trick is to superscript the "rd;st;nd" string and the "th" near the end
of the field.

Cheers
PS: Note that the field braces '{}' are all entered in pairs via Ctrl-F9.
 
R

Richard

Thank you very much for the response.

Unfortunately, it does not appear to work. I copied the mergefield code
into the document after using ALT-F9 to view the codes. Changed the Data
Column to MergeDate and changed the date to dd/mm/yyyy. When I switch back,
nothing appears in the location.

I thought maybe it was the spacing, i.e. I tried inserting a space between
QUOTE and { but I then get the error message Error! Too many picture
switches defined.

Using just the merge code { MERGEFIELD MergeDate } it shows 8/04/2004

Did you get the code to work for you? Any idea what I am doing wrong?

Yours truly,

Richard


the following mergefield code should achieve what you're after:
 
M

macropod

Hi Richard,

I should have included '=' signs before each 'Data' ref after the SET field,
as in:

{QUOTE{SET Data{MERGEFIELD MergeDate}}{=Data \@ d}{IF{=(mod({=Data \@
d},10)<4)*(mod({=Data \@ d},10)<>0)*({=Data \@ d}<>11)*({=Data \@
d}<>12)*({=Data \@ d}<>13)}= 1 {=mod("{=Data \@ d},10)-2 \# rd;st;nd} th}"
of "{=Data \@ "MMMM yyyy"}}

Cheers
 
M

macropod

Hi Richard,

Seems the last solution insists on inserting today's date. Try:

{QUOTE{MERGEFIELD MergeDate \@ d}{IF{=(mod({MERGEFIELD MergeDate \@
d},10)<4)*(mod({MERGEFIELD MergeDate \@ d},10)<>0)*({ MERGEFIELD MergeDate
\@ d}<>11)*({ MERGEFIELD MergeDate \@ d}<>12)*({ MERGEFIELD MergeDate \@
d}<>13)}= 1 {=mod({MERGEFIELD MergeDate \@ d},10)-2 \# rd;st;nd} th}" of
"{MERGEFIELD MergeDate \@ "MMMM yyyy"}}

instead.

Cheers
 
Joined
Aug 8, 2023
Messages
1
Reaction score
0
Please i have been trying the solution provided but having challenges. Can i copy the code and insert it in the code area? If not kindly guide me through it. Would be very grateful.
 
Joined
Sep 19, 2023
Messages
3
Reaction score
0
The final solution does work.

Thank you for your help.

Yours truly,

Richard
hi richard

i tried the solution but somehow i could not get the result, may be i dont know exactly how to use the solution. can you please share the link of your data source file and word file or you can just mail me to (e-mail address removed) please
 
Joined
Sep 19, 2023
Messages
3
Reaction score
0
Hi,

Seems the last solution insists on inserting today's date. Try:

{QUOTE{MERGEFIELD MergeDate \@ d}{IF{=(mod({MERGEFIELD MergeDate \@
d},10)<4)*(mod({MERGEFIELD MergeDate \@ d},10)<>0)*({ MERGEFIELD MergeDate
\@ d}<>11)*({ MERGEFIELD MergeDate \@ d}<>12)*({ MERGEFIELD MergeDate \@
d}<>13)}= 1 {=mod({MERGEFIELD MergeDate \@ d},10)-2 \# rd;st;nd} th}" of
"{MERGEFIELD MergeDate \@ "MMMM yyyy"}}

instead.

Cheers
hi richard

i tried the solution but somehow i could not get the result, may be i dont know exactly how to use the solution. can you please share the link of your data source file and word file or you can just mail me to (e-mail address removed) please
 
Joined
Sep 19, 2023
Messages
3
Reaction score
0
Please i have been trying the solution provided but having challenges. Can i copy the code and insert it in the code area? If not kindly guide me through it. Would be very grateful.
hey...did you get the solution bro?
 

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