惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Blog — PlanetScale
Blog — PlanetScale
GbyAI
GbyAI
Engineering at Meta
Engineering at Meta
博客园 - 司徒正美
T
Tailwind CSS Blog
F
Full Disclosure
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
小众软件
小众软件
IT之家
IT之家
J
Java Code Geeks
Y
Y Combinator Blog
Microsoft Security Blog
Microsoft Security Blog
B
Blog
V
V2EX
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Hugging Face - Blog
Hugging Face - Blog
美团技术团队
The Cloudflare Blog
Recent Announcements
Recent Announcements
博客园 - 【当耐特】
Google DeepMind News
Google DeepMind News
罗磊的独立博客
博客园 - 叶小钗
阮一峰的网络日志
阮一峰的网络日志
The GitHub Blog
The GitHub Blog
云风的 BLOG
云风的 BLOG
aimingoo的专栏
aimingoo的专栏
大猫的无限游戏
大猫的无限游戏
酷 壳 – CoolShell
酷 壳 – CoolShell
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
S
Security @ Cisco Blogs
MyScale Blog
MyScale Blog
MongoDB | Blog
MongoDB | Blog
U
Unit 42
H
Heimdal Security Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
V2EX - 技术
V2EX - 技术
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Google Online Security Blog
Google Online Security Blog
N
News and Events Feed by Topic
Hacker News - Newest:
Hacker News - Newest: "LLM"
PCI Perspectives
PCI Perspectives
博客园 - 三生石上(FineUI控件)
I
InfoQ
SecWiki News
SecWiki News
N
News and Events Feed by Topic
D
DataBreaches.Net
Schneier on Security
Schneier on Security
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO

博客园 - 落尘

.NET上传图片加文字和水印图片源码 - 落尘 - 博客园 ASP.NET下的多文件上传 ASP.NET 2.0 多文件上传小经验 文件的上传和下载 在ASP.NET程序中实现语音合成 .Net平台下开发中文语音应用程序 语音合成与识别技术在C#中的应用 如何防止ASP 木马在服务器上运行 用ASP实现在线压缩与解压缩 asp对象化之:基于adodb.stream的文件操作类 js鼠标及对象坐标控制属性 NET中各种数据库连接大全 几个ASP.NET技巧 设计ASP.NET应用程序的七大绝招 ASP.NET中如何调用存储过程 Asp.net cache 简述 单点登陆 硬盘双击无法打开是咋回事 Asp.net直接保存文件到客户端
如何用C#把Doc文档转换成rtf格式
落尘 · 2006-11-27 · via 博客园 - 落尘

先在项目引用里添加上对Microsoft Word 9.0 object library的引用。

using System;

namespace DocConvert

{
class DoctoRtf
{
  static void Main()
  {

//创建一个word的实例
   Word.Application newApp = new Word.Application();

   // 指定源文件和目标文件
   object Source="c:\\abc\\Source.doc";
   object Target="c:\\abc\\Target.rtf";

   object Unknown =Type.Missing;

   // 打开要转换的Word文件
   newApp.Documents.Open(ref Source,ref Unknown,
    ref Unknown,ref Unknown,ref Unknown,
    ref Unknown,ref Unknown,ref Unknown,
    ref Unknown,ref Unknown,ref Unknown,
    ref Unknown );

   // 指定文档的类型
   object format = Word.WdSaveFormat.wdFormatRTF;

   //改变文档类型
   newApp.ActiveDocument.SaveAs(ref Target,ref format,
    ref Unknown,ref Unknown,ref Unknown,
    ref Unknown,ref Unknown,ref Unknown,
    ref Unknown,ref Unknown,ref Unknown);                   

   //关闭word实例
   newApp.Quit(ref Unknown,ref Unknown,ref Unknown);

  }
}
}