Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. non english character problem !!!

non english character problem !!!

Scheduled Pinned Locked Moved C#
htmlcomhelpquestionannouncement
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    TALHAKOSEN
    wrote on last edited by
    #1

    (i hope i write true place) Hi all, i use the two method shown below, to sent text as html to a word document, but non english characters arent shown in the document. what can i do?? private void button2_Click(object sender, EventArgs e) { WordApp = new Word.ApplicationClass(); fileName = @"........"; Microsoft.Office.Interop.Word.Document aDoc = WordApp.Documents.Open(ref fileName, ref missing, ref readOnly, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref Format, ref missing, ref isVisible, ref missing, ref missing, ref missing, ref missing); WordApp.Visible = true; bookmarkPaste(aDoc, bookmarkinWordDoc,myHtmlScript); } **public void bookmarkPaste(Word.Document aDoc, string bookmarkAdi, string data)** { try { object bookmark = bookmarkAdi; object missing = System.Reflection.Missing.Value; object pasteType = Word.WdPasteDataType.wdPasteHTML; DataObject clipDO = new DataObject(); if (aDoc.Bookmarks.Exists(bookmark.ToString())) { Word.Range rangeTbl = aDoc.Bookmarks.get_Item(ref bookmark).Range; clipDO.SetData(DataFormats.Html,**HtmlClipboardData**(data)); Clipboard.SetDataObject(clipDO, true); rangeTbl.PasteSpecial(ref missing, ref missing, ref missing, ref missing, ref pasteType, ref missing, ref missing); } else { } } catch (Exception exc) { MessageBox.Show(exc.Message); } } **private static string HtmlClipboardData(string html)** { StringBuilder sb = new StringBuilder(); Encoding encoding = Encoding.UTF8; string Header = @" Version: 1.0 StartHTML: {0:000000} EndHTML: {1:000000} StartFragment: {2:000000} EndFragment: {3:000000} "; string HtmlPrefix = @" DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.0 Transitional//EN""&; html; head; meta http-equiv=Content-Type content=""text/html; charset={0}""; /head;

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups