不安装WORD2000,WPS2000,想编程实现把WORD,WPS文档转换成txt,html文件,谁可指导?在程序中怎么调用C:\Program Files\Common Files\Microsoft Shared\TEXTCONV下的.CNV文件?

zdl2000 2001-03-05 07:14:00
不安装WORD2000,WPS2000,想编程实现把WORD,WPS文档转换成txt,html文件,谁可指导?在程序中怎么调用C:\Program Files\Common Files\Microsoft Shared\TEXTCONV下的.CNV文件?
...全文
262 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
david_lirihui 2001-03-06
  • 打赏
  • 举报
回复
很费劲的说呀!我曾经在delphi中弄过,结果以失败告终!不过还是可以谈谈经验!word &wps的文件格式与普通的文件不同,他们是称做复合文档的文件格式。复合文档包括两个部分,IStorage&IStream,你可以把前者看成是目录,而后者是目录中具体的文件。(参考微软的MSDN)微软提供了访问它们的方法。通过OLE中的API函数去访问。IStorage中有OpenStorage方法:IStorage::OpenStorage
Opens an existing storage object with the specified name in the specified access mode.

HRESULT OpenStorage(
const WCHAR * pwcsName, //Points to the name of the storage
// object to open
IStorage * pstgPriority, //Points to previous opening of the
// storage object
DWORD grfMode, //Access mode for the new storage object
SNB snbExclude, //Points to a block of stream names in
// the storage object
DWORD reserved, //Reserved; must be zero
IStorage ** ppstg //Points to opened storage object
);
//还有OpenStream方法
HRESULT OpenStream(
const WCHAR * pwcsName, //Points to name of stream to open
void * reserved1, //Reserved; must be NULL
DWORD grfMode, //Access mode for the new stream
DWORD reserved2, //Reserved; must be zero
IStream ** ppstm //Address of output variable that
// receives the IStream interface pointer
);
(微软的MSDN有详细介绍,你自己去看看吧!但愿祝你成功!成功了别忘了给我告诉我一声,davylirihui@263.net)

70,037

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧