diff --git a/funcext/TSOffice/TSUtils/TOfficeApi.tsf b/funcext/TSOffice/TSUtils/TOfficeApi.tsf index 3811999..3b8ce68 100644 --- a/funcext/TSOffice/TSUtils/TOfficeApi.tsf +++ b/funcext/TSOffice/TSUtils/TOfficeApi.tsf @@ -178,6 +178,27 @@ Type TOffice = Class Begin return getTextBoxImpl(p, true); End; + + ///获取docx的类型 + ///普通段落:0 + ///图片段落:1 + ///表格:2 + ///其他:-1 + class Function GetDocxPartType(part); + Begin + if not ifObj(part) then return -1; + case part.name_ of + 'w:p': + begin + if class(TSXml).GetNode(part.node_, 'w:r/w:drawing') then return 1; + return 0; + end + 'w:tbl': + return 2; + else + return -1; + end; + End; Function Set(k, v); Begin