Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / March 2007

Tip: Looking for answers? Try searching our database.

Unicode characters problem in MailMerge using Excel

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dhwanitdesai@gmail.com - 16 Mar 2007 17:23 GMT
Hey...

I'm having problem displaying double-byte characters using mail merge
functionality. In my application, we're using Excel sheet as a
datasource for a word template document. We open a datasource using
OpenDatasource method. But when spreadsheet column has a double-byte
characters in its data, in Word document, when we merge the field, it
displays lots of "?" instead.

Data is being displayed fine in spreadsheet.

Also, when I manually open a datasource from a word for the same
spreadsheet and then merge fields, data is perfect. It doesn't display
garbages....

Any ideas/suggestions is appreciated.

Thanks,
- Dhwanit
Peter Jamieson - 16 Mar 2007 17:42 GMT
Which version of Word/Excel, and can you show the code for your
OpenDataSource please?

Peter Jamieson
> Hey...
>
[quoted text clipped - 15 lines]
> Thanks,
> - Dhwanit
dhwanitdesai@gmail.com - 19 Mar 2007 13:28 GMT
On Mar 16, 12:42 pm, "Peter Jamieson"
<p...@KillmapSpjjnet.demon.co.uk> wrote:
> Which version of Word/Excel, and can you show the code for your
> OpenDataSource please?
[quoted text clipped - 24 lines]
>
> - Show quoted text -

Hey....We're  using office 2003 SP2 for word and excel both...as far
as code goes, call is right here...

ODBC:

m_doc.MailMerge.OpenDataSource(Name:="", _
                      Connection:="DSN=Excel Files;DBQ=" &
m_strDsName & ";", _
                      SQLStatement:="SELECT * FROM `Sheet1$`", _
                      SubType:=WdMergeSubType.wdMergeSubTypeWord2000)

DDE:
                   m_doc.MailMerge.OpenDataSource( _
                       Name:=m_strDsName, _
                       Connection:="Entire Spreadsheet", _

SubType:=WdMergeSubType.wdMergeSubTypeWord2000)

Thanks....
Dhwanit
Peter Jamieson - 20 Mar 2007 09:05 GMT
Unless you really are dealing with "older-style" double-byte characters, the
problem is that neither ODBC nor DDE will preserve Unicode characters (which
I know is not necessarily the same thing, but is likely to be what needs to
come across regardless of what encoding you think you are using. You really
have to use OLE DB (the default connection method in Word 2003) to do that -
I would suggest:

OLEDB:

m_doc.MailMerge.OpenDataSource(Name:=m_strDsName, _
                     Connection:="", _
                     SQLStatement:="SELECT * FROM `Sheet1$`"

Although I don't hink it has any particular bearing on this issue, you might
also find some of http://tips.pjmsn.me.uk/t0003.htm useful

Peter Jamieson

> On Mar 16, 12:42 pm, "Peter Jamieson"
> <p...@KillmapSpjjnet.demon.co.uk> wrote:
[quoted text clipped - 47 lines]
> Thanks....
> Dhwanit
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.