Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Microsoft Word 2016 Hebrew Language pack - Using Macro to insert merge field does not display Hebrew characters

Posted on 2016-08-17
8
97 Views
Last Modified: 2016-08-22
Microsoft Word 2016 Hebrew Language pack - I am using a Macro to insert merge fields into a document, but it does not display Hebrew characters. Only after closing and saving the document and then reopening, will it prompt me for the language encoding, and upon selecting Hebrew, it displays the proper Hebrew characters.
I tried selecting in Word in the File menu, Options, Advanced, General, and checked the box "Confirm File Format Conversion on Open" but it does not solve the problem, when using the macro to insert the merge field.
How can I have the proper characters displayed in the first place, upon inserting the merge fields?

By the way, does anyone understand why must I confirm the file format conversion language if the system should know what language I am using being that I installed the Hebrew Language Pack?
0
Comment
Question by:Moshe Singer
  • 5
  • 3
8 Comments
 
LVL 27

Expert Comment

by:MacroShadow
ID: 41760275
How did you create your merge source file?
0
 

Author Comment

by:Moshe Singer
ID: 41760330
csv, ascii text ,delimited
0
 

Author Comment

by:Moshe Singer
ID: 41760335
the source file is exported from access
and after closing and saving the document and then reopening, will it prompt me for the language encoding, and upon selecting Hebrew, it displays the proper Hebrew characters
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 27

Accepted Solution

by:
MacroShadow earned 500 total points
ID: 41760507
I've seen that happen before.
Try running the source file through this sub before starting the merge:
Sub ConvertCharset(strFile As String)
    Dim fso As Object, stream As Object
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set stream = CreateObject("ADODB.Stream")
    With stream
        .Open
        .Type = 2    'text
        .Charset = "windows-1255"
        .LoadFromFile strFile
    End With
    fso.OpenTextFile(strFile, 2, True, True).Write stream.ReadText
    stream.Close

    Set fso = Nothing
    Set stream = Nothing
End Sub

Open in new window

0
 

Author Comment

by:Moshe Singer
ID: 41761219
thanks for your response
here is the code I am using
Please explain where to use your code - and which one of my files must I place instead of the "strFile"

Sub macro()
 On Error GoTo error
   
    ActiveDocument.MailMerge.MainDocumentType = wdFormLetters
     Application.Keyboard (1033)
    ActiveDocument.MailMerge.OpenDataSource Name:= _
        "C:\WORDLeters\detail.csv", ConfirmConversions:=True, ReadOnly:= _
        False, LinkToSource:=True, AddToRecentFiles:=False, PasswordDocument:="", _
         PasswordTemplate:="", WritePasswordDocument:="", WritePasswordTemplate:= _
        "", Revert:=False, Format:=wdOpenFormatAuto, Connection:="", SQLStatement _
        :="", SQLStatement1:=""
    ActiveDocument.MailMerge.EditMainDocument
Exit Sub
error:
Dim Msg, Title, Response, MyString
Msg = msg
Title = title
Response = MsgBox(Msg, , Title)
End Sub
0
 

Author Closing Comment

by:Moshe Singer
ID: 41761252
thanks a milion
0
 
LVL 27

Expert Comment

by:MacroShadow
ID: 41761276
Did you figure out how to do it?
0
 

Author Comment

by:Moshe Singer
ID: 41766228
in place of strFile= I insert the address of the csv file
if you can please  figure out  for me the Hebrew code - I used your code, and the first time it worked, the second time I opend the file it wad damged like a different lang
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
This Micro Tutorial well show you how to find and replace special characters in Microsoft Word. This is similar to carriage returns to convert columns of values from Microsoft Excel into comma separated lists.

838 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question