Solved

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

Posted on 2016-08-17
8
114 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
[X]
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
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.

691 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