2

I used a solution from stackoverflow to do the mail merge through a macros, it works fine but there are some chinese character numbers which becomes arabic numbers after the mail merge. Normally if i do the mail merge manually, i saved it as a .csv and the chinese character numbers would still show in the merged document. However, I can't save a marcos in .csv, therefore it would be great if somebody could provide a solution to the macros so that the Chinese character numbers can show in the merged word document.

I use this code from : Executing Word Mail Merge

Sub RunMerge()

    Dim wd As Object
    Dim wdocSource As Object

    Dim strWorkbookName As String

    On Error Resume Next
    Set wd = GetObject(, "Word.Application")
    If wd Is Nothing Then
       Set wd = CreateObject("Word.Application")
    End If
    On Error GoTo 0

    Set wdocSource = wd.Documents.Open("c:\test\WordMerge.docx")

    strWorkbookName = ThisWorkbook.Path & "\" & ThisWorkbook.Name

    wdocSource.MailMerge.MainDocumentType = wdFormLetters

    wdocSource.MailMerge.OpenDataSource _
        Name:=strWorkbookName, _
        AddToRecentFiles:=False, _
        Revert:=False, _
        Format:=wdOpenFormatAuto, _
        Connection:="Data Source=" & strWorkbookName & ";Mode=Read", _
        SQLStatement:="SELECT * FROM `Sheet1$`"

    With wdocSource.MailMerge
        .Destination = wdSendToNewDocument
        .SuppressBlankLines = True
        With .DataSource
           .FirstRecord = wdDefaultFirstRecord
           .LastRecord = wdDefaultLastRecord
        End With
        .Execute Pause:=False
    End With

    wd.Visible = True
    wdocSource.Close SaveChanges:=False

    Set wdocSource = Nothing
    Set wd = Nothing

End Sub
Community
  • 1
  • 1

1 Answers1

0

Please try it by changing your system language to Chinese. Once I was also suffering through this type of problem for Japanese character. It helped me, May be this may also help you.

Pallav Raj
  • 1,684
  • 3
  • 17
  • 29