A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Mailmerge
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How to keep Access MergeField from losing formatting in Word 2003



 
 
Thread Tools Display Modes
  #1  
Old February 23rd, 2009, 05:15 PM posted to microsoft.public.word.mailmerge.fields
Seventh.Son[_2_]
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  
Old February 24th, 2009, 08:49 AM posted to microsoft.public.word.mailmerge.fields
Graham Mayor
external usenet poster
 
Posts: 18,297
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  
Old February 24th, 2009, 11:23 AM posted to microsoft.public.word.mailmerge.fields
Peter Jamieson
external usenet poster
 
Posts: 4,550
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.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:25 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.