?
Solved

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

Posted on 2016-08-17
8
Medium Priority
?
136 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
Does Your Cloud Backup Use Blockchain Technology?

Blockchain technology has already revolutionized finance thanks to Bitcoin. Now it's disrupting other areas, including the realm of data protection. Learn how blockchain is now being used to authenticate backup files and keep them safe from hackers.

 
LVL 27

Accepted Solution

by:
MacroShadow earned 2000 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

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!

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

762 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