L
lwm1
Unregistered / Unconfirmed
GUEST, unregistred user!
有一个问题想请教大家:如何通过OLE从Word文档中取出它的目录结构的标题,我只知道如下写: 这样很麻烦,不知到还有什么方法?不胜感激!!!
WordApp:=CreateComObject(CLASS_Application) as _Application;
WordApp.Documents.Open(FileName1,
ConfirmConversions1,
ReadOnly1,
AddToRecentFiles1,
PasswordDocument1,
PasswordTemplate1,
Revert1,
WritePasswordDocument,
WritePasswordTemplate1,
Format1);
for i:=1 to WordApp.ActiveDocument.TablesOfContents.Count do
begin
with WordApp.ActiveDocument.TablesOfContents.Item(i).Range.Words do
for m:=1 to Count do
begin
??????。。。。。
end;
end;
WordApp:=CreateComObject(CLASS_Application) as _Application;
WordApp.Documents.Open(FileName1,
ConfirmConversions1,
ReadOnly1,
AddToRecentFiles1,
PasswordDocument1,
PasswordTemplate1,
Revert1,
WritePasswordDocument,
WritePasswordTemplate1,
Format1);
for i:=1 to WordApp.ActiveDocument.TablesOfContents.Count do
begin
with WordApp.ActiveDocument.TablesOfContents.Item(i).Range.Words do
for m:=1 to Count do
begin
??????。。。。。
end;
end;