打开.doc后,如何识别出文档的标题? 打开.doc后,如何识别出文档的标题? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 using System;using Excel=Microsoft.Office.Interop.Excel;using Word = Microsoft.Office.Interop.Word;namespace ctrexecel{ /// <summary> /// Class1 的摘要说明。 /// </summary> class Class1 { /// <summary> /// 应用程序的主入口点。 /// </summary> [STAThread] static void Main(string[] args) { // // TODO: 在此处添加代码以启动应用程序 // object opt = System.Reflection.Missing.Value; Word.Application app = new Word.ApplicationClass(); string strfile = "c:\\1.doc"; object file = strfile; app.Documents.Open( ref file , ref opt , ref opt , ref opt , ref opt ,ref opt , ref opt ,ref opt, ref opt , ref opt , ref opt , ref opt , ref opt , ref opt, ref opt , ref opt ); app.Visible = true; Word.Document doc = app.ActiveDocument; for( int i=1 ; i<=doc.Paragraphs.Count ; i++) { Word.Paragraph pg = doc.Paragraphs[i]; Word.Style style = (Word.Style)pg.get_Style(); string strstyle = style.NameLocal; System.Console.WriteLine( strstyle);//如果strtyle="标题1"就是标题 } app.Quit( ref opt , ref opt , ref opt ); } }}office2003 + vs.net 线程问题 关于textbox回车响应问题。 OWC生成的线状图,横坐标是时间,纵坐标是销售数据,线上面的销售数据怎么去掉呢? 百分提问,DLL引用失败 ip代理器下载地址 DES算法加密解密代码解析 C#编程题求解 Windows服务启动时出错.但功能已经可以用了而且正常.但是停止按钮却不能用. 菜鸟求教 C#程序员的¥为多少? 实现模拟project功能 从xml文件当中读写二进制数据
using Excel=Microsoft.Office.Interop.Excel;
using Word = Microsoft.Office.Interop.Word;
namespace ctrexecel
{
/// <summary>
/// Class1 的摘要说明。
/// </summary>
class Class1
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main(string[] args)
{
//
// TODO: 在此处添加代码以启动应用程序
//
object opt = System.Reflection.Missing.Value;
Word.Application app = new Word.ApplicationClass();
string strfile = "c:\\1.doc";
object file = strfile;
app.Documents.Open( ref file , ref opt , ref opt , ref opt , ref opt ,ref opt , ref opt ,ref opt,
ref opt , ref opt , ref opt , ref opt , ref opt , ref opt, ref opt , ref opt );
app.Visible = true;
Word.Document doc = app.ActiveDocument;
for( int i=1 ; i<=doc.Paragraphs.Count ; i++)
{
Word.Paragraph pg = doc.Paragraphs[i];
Word.Style style = (Word.Style)pg.get_Style();
string strstyle = style.NameLocal;
System.Console.WriteLine( strstyle);//如果strtyle="标题1"就是标题
}
app.Quit( ref opt , ref opt , ref opt );
}
}
}
office2003 + vs.net