R
rainsea
Unregistered / Unconfirmed
GUEST, unregistred user!
var
I : Integer;
TempParagraphs : Paragraphs;
ParaStyle : OleVariant;
begin
I := 1;
TempParagraphs := WD.Paragraphs;(wd是TWordDocument类型)
while I < TempParagraphs.Count do
begin
ParaStyle := TempParagraphs.Item(I).Get_Style;
if ParaStyle = '标题 1' then(这里的比较有错误,说不合法的OleVariant操作)
ShowMessage(ParaStyle);
//我的本意是在这里记录标题的内容,但不知道怎么做
Inc(I);
end;
end;
I : Integer;
TempParagraphs : Paragraphs;
ParaStyle : OleVariant;
begin
I := 1;
TempParagraphs := WD.Paragraphs;(wd是TWordDocument类型)
while I < TempParagraphs.Count do
begin
ParaStyle := TempParagraphs.Item(I).Get_Style;
if ParaStyle = '标题 1' then(这里的比较有错误,说不合法的OleVariant操作)
ShowMessage(ParaStyle);
//我的本意是在这里记录标题的内容,但不知道怎么做
Inc(I);
end;
end;