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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|