如何控制往Word属性中的摘要中写作者名,和标题! 如题!特急!谢谢, 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 oWord:Word.ApplicationoWord.ActiveDocument.BuiltInDocumentProperties(Index).valueIndex=1 标题(Title)Index=2 主题(Subject)Index=3 作者(Author)Index=4 关键词(Keywords)Index=5 备注(Comments)Index=6 模板(Template)Index=7 单位(Last author) uses ComObjfunction IsFileInUse(const FileName:String):Boolean;var FileStrm:TFileStream;begin Result:=false; try FileStrm:=TFileStream.Create(FileName,fmOpenReadWrite); FileStrm.Free; except Result:=true; end;end;procedure TForm1.Button1Click(Sender: TObject);var oWord:OleVariant; FileName:String;begin FileName:='C:\Documents and Settings\Administrator\Desktop\料品库存异动汇总表.doc'; if not FileExists(FileName) then exit; if IsFileInUse(FileName) then exit;//检查文件是否被打开,否则不能修改 oword := CreateOLEObject('Word.Application'); Sleep(100);//等待Word启动 oword.documents.open(FileName); oWord.ActiveDocument.BuiltInDocumentProperties(1):='测试修改Word文档属性'; //标题(Title) oWord.ActiveDocument.BuiltInDocumentProperties(2):='修改Word相关信息'; //主题(Subject) oWord.ActiveDocument.BuiltInDocumentProperties(3):='最好玩滴那个'; //作者(Author) oWord.ActiveDocument.BuiltInDocumentProperties(4):='修改 文档 属性'; //关键词(Keywords) oWord.ActiveDocument.BuiltInDocumentProperties(5):='就是最好玩滴那个干滴好事啦,嘻嘻';//备注(Comments) //oWord.ActiveDocument.BuiltInDocumentProperties(6) //模板(Template) oWord.ActiveDocument.BuiltInDocumentProperties(7):='不记得是在哪个单位了'; //单位(Last author) oword.ActiveDocument.Save; oword.quit;end; 如何实现服务器与子机的通信 一个关于ProgressBar的问题,请高手赐教 Delphi游戏界面开发 有关存储问题? 老大们怎么做程序更新呀!快来呀来着有分呀 设置打印机属性后,为何调用QUICK REPORT的PREVIEW窗口中查看打印机设置会没有起作用? 怎么将支持DELPHI的报表控件用在VC里呢? 一个SQL的小问题 请问如何获取当前sql server7.0 服务器的时间 请帮助:TTreeView当选择新节点时,如何得到上一个被选节点 哇哇 请问有关数据库三层架构的问题
oWord.ActiveDocument.BuiltInDocumentProperties(Index).valueIndex=1 标题(Title)
Index=2 主题(Subject)
Index=3 作者(Author)
Index=4 关键词(Keywords)
Index=5 备注(Comments)
Index=6 模板(Template)
Index=7 单位(Last author)
ComObjfunction IsFileInUse(const FileName:String):Boolean;
var
FileStrm:TFileStream;
begin
Result:=false;
try
FileStrm:=TFileStream.Create(FileName,fmOpenReadWrite);
FileStrm.Free;
except
Result:=true;
end;
end;procedure TForm1.Button1Click(Sender: TObject);
var
oWord:OleVariant;
FileName:String;
begin
FileName:='C:\Documents and Settings\Administrator\Desktop\料品库存异动汇总表.doc';
if not FileExists(FileName) then exit;
if IsFileInUse(FileName) then exit;//检查文件是否被打开,否则不能修改
oword := CreateOLEObject('Word.Application');
Sleep(100);//等待Word启动
oword.documents.open(FileName);
oWord.ActiveDocument.BuiltInDocumentProperties(1):='测试修改Word文档属性'; //标题(Title)
oWord.ActiveDocument.BuiltInDocumentProperties(2):='修改Word相关信息'; //主题(Subject)
oWord.ActiveDocument.BuiltInDocumentProperties(3):='最好玩滴那个'; //作者(Author)
oWord.ActiveDocument.BuiltInDocumentProperties(4):='修改 文档 属性'; //关键词(Keywords)
oWord.ActiveDocument.BuiltInDocumentProperties(5):='就是最好玩滴那个干滴好事啦,嘻嘻';//备注(Comments)
//oWord.ActiveDocument.BuiltInDocumentProperties(6) //模板(Template)
oWord.ActiveDocument.BuiltInDocumentProperties(7):='不记得是在哪个单位了'; //单位(Last author)
oword.ActiveDocument.Save;
oword.quit;
end;