Solved

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

Posted on 2016-08-17
8
105 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
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: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

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.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
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.
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…

749 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