如何使用Microsoft.Office.Interop获得页面边框样式



我需要验证一下Microsoft Word的页面边框样式。我必须验证边框样式是否为box page border类型。我在我的项目中使用Microsoft interop dll

我已经使用了以下代码,但它返回true为其他边框样式。

m_doc.Sections.Item(1).Borders.OutsideLineStyle = WdLineStyle.wdLineStyleSingle

请检查以下代码

If (m_doc.Sections(1).Borders(WdBorderType.wdBorderLeft).LineStyle >= 1 And
m_doc.Sections(1).Borders(WdBorderType.wdBorderRight).LineStyle >= 1 And
m_doc.Sections(1).Borders(WdBorderType.wdBorderRight).LineStyle >= 1 And
m_doc.Sections(1).Borders(WdBorderType.wdBorderTop).LineStyle = 1) Then
    'Your Code
End If

1 =线条样式单一的边境

最新更新