往word里插入文字 往word里插入文字的时候,假如是插入纯文字可以但是假如我想插入的文字“aabbcc”中"aa"用红色,"bb"用黑色粗体,"cc"用绿色,这样就不行了应该怎么样搞 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 "<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>" 楼上的,你的这段是html代码,假如我将html代码插入进去,他不像IE那样自动识别,我不知道怎么样才能生效。不要叫我直接用word打开html文件的方法,那样效果非常差. //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 word/excel 你不知道一个功能怎么写的话,就录制一个宏,自己用word操作一遍,然后看宏里生成的vb代码,就了解该调用些word/excel的啥方法和怎么写了 3楼的可以把,实在不行写rtf码。 新手namespace 不太明白,帮忙解释! .net 下 TreeView的一个奇怪问题 如何不改变传递参数中的对象(附代码)? WndProc问题求助 程序集问题 请高手进来指教 c#datatable使用问题 异步下载类 循环调用 的问题 WebClient使用报错 简单问题,分很多 如何把数据库中的数据实时反映到dataGridView 求串口用委托的详细例子,不要网上复制来的 在AJAX中,提交数据后使按钮变灰,当数据回传到页面后,又返回原来的状态,怎么实现??
//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