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

时间:2015-09-25 06:24:35

标签: vb.net

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

我使用了以下代码,但对其他边框样式也返回true。

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

1 个答案:

答案 0 :(得分:1)

请检查以下代码

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 =线条样式单边框