往word里插入文字的时候,假如是插入纯文字可以但是假如我想插入的文字“aabbcc”中"aa"用红色,"bb"用黑色粗体,"cc"用绿色,这样就不行了应该怎么样搞

解决方案 »

  1.   

    "<span lang=3DEN-US style=3D'color:=red'>aa</span>""<b style=3D'mso-bidi-font-weight:normal'><span lang=3DEN-US>bb</span></b>""<span lang=3DEN-US style=3D'color:green'>cc</span></span>"
      

  2.   

    楼上的,你的这段是html代码,假如我将html代码插入进去,他不像IE那样自动识别,我不知道怎么样才能生效。不要叫我直接用word打开html文件的方法,那样效果非常差.
      

  3.   


    //Insert a paragraph at the beginning of the document.
    Microsoft.Office.Interop.Word.Paragraph oPara1;
    oPara1 = oDoc.Content.Paragraphs.Add(ref oMissing);
    oPara1.Range.Text = "Heading 1";
    oPara1.Range.Font.Bold = 1;
    oPara1.Range.Font.Color = Microsoft.Office.Interop.Word.WdColor.wdColorRed;//设置颜色为红色
    oPara1.Format.SpaceAfter = 24;    //24 pt spacing after paragraph.
    oPara1.Range.InsertParagraphAfter();参考
    http://support.microsoft.com/kb/316384/zh-cn
      

  4.   

    word/excel 你不知道一个功能怎么写的话,就录制一个宏,自己用word操作一遍,然后看宏里生成的vb代码,就了解该调用些word/excel的啥方法和怎么写了
      

  5.   

    3楼的可以把,实在不行写rtf码。