question

LittyJoseph-6943 avatar image
0 Votes"
LittyJoseph-6943 asked Viorel-1 commented

Render using Range.InsertFile

Hi Team,

I am using below code to insert an html file into a word document. After saving and opening the doc its showing some junk characters for some specific texts. Please see the screenshots of temp3_htm and temp_docx .

string htmlFile = @"C:\Users\admin\Desktop\Temp_3.htm";
para1.Range.InsertFile(htmlFile, System.Type.Missing, System.Type.Missing, System.Type.Missing, false);

//Save the document
object filename = @"C:\Users\admin\Desktop\temp.docx";
document.SaveAs2(ref filename);

I am seeing this issue with names start with "EN -" ("E N -") or starts with a Japanese characters.(eg. "テスト" . )
Could you please check this?

145793-temp3-htm.jpg

145763-code.txt

145727-temp-docx.jpg


office-vba-devoffice-word-itpro
temp3-htm.jpg (118.8 KiB)
code.txt (1.7 KiB)
temp-docx.jpg (65.9 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@LittyJoseph-6943
As tag “office-word-itpro“ is more related to general issue of Word client, but your issue focuses more on general issue of VBA code.
To better help you, I would modify the tag.
Thanks for your understanding.

0 Votes 0 ·

Did you observe the issue if you perform these operations (insert, save, close, open) manually in Word?


0 Votes 0 ·

0 Answers