Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Seventh.Son[_2_] Seventh.Son[_2_] is offline
external usenet poster
 
Posts: 1
Default How to keep Access MergeField from losing formatting in Word 2003

I have an alphanumeric Charge number (text field) formatted with hyphens -
e.g., 21B-2009-01234. If I use that formatted field in MS Word 2003 the
hyphens are stripped out. However, if I simply copy and paste into MS Word,
the hyphens remain. There doesn't seem to be any "switch" to restore the
formatting.

Thank you.
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default How to keep Access MergeField from losing formatting in Word 2003

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



Seventh.Son wrote:
I have an alphanumeric Charge number (text field) formatted with
hyphens - e.g., 21B-2009-01234. If I use that formatted field in MS
Word 2003 the hyphens are stripped out. However, if I simply copy and
paste into MS Word, the hyphens remain. There doesn't seem to be any
"switch" to restore the formatting.

Thank you.



  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default How to keep Access MergeField from losing formatting in Word2003

In this type of situation I do not think the "DDE" approach works and
the simplest solution is probably to create a new query in your Access
database that takes the data that Access actually stores (i.e.
21B200901234) and re-insert the hyphens.

For example, if your data source is called mytable and the field is
called charge, your query SQL could look like

SELECT left(charge,3) & '-' & mid(charge,4,4) & '-' & right(charge,5) AS
[hyphencharge], *
FROM mytable;

Then use that query as your data source. You should be able to connect
using the default OLE DB method.

If you are not in a position to modify your Access database, you can set
up the same query in Word VBA, e.g. perhaps using

ActiveDocument.MailMerge.OpenDataSource _
Name:="the full pathname of the .mdb", _
SQLStatement:= _
" SELECT left(charge,3) & '-' & mid(charge,4,4)" & _
" & '-' & right(charge,5) AS [hyphencharge], *" & _
" FROM mytable"


Peter Jamieson

http://tips.pjmsn.me.uk

Seventh.Son wrote:
I have an alphanumeric Charge number (text field) formatted with hyphens -
e.g., 21B-2009-01234. If I use that formatted field in MS Word 2003 the
hyphens are stripped out. However, if I simply copy and paste into MS Word,
the hyphens remain. There doesn't seem to be any "switch" to restore the
formatting.

Thank you.

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
Mergefield Formatting - Trim function? Word 2000 Chris Stammers Mailmerge 5 December 10th 09 10:00 AM
Losing phone # format from Access 2003 to Mail Merge LMiller Mailmerge 2 August 31st 06 04:10 AM
How can I reorder pages in Word 2003 without losing formatting? kwest918 Microsoft Word Help 1 June 17th 06 05:31 AM
Losing formatting in Form Fields in Word 2003 Andy Tables 1 April 12th 05 03:58 PM
Word 2003 - Losing formatting from Word 2002 document PCScholar Microsoft Word Help 3 March 27th 05 05:05 PM


All times are GMT +1. The time now is 09:42 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"