Reputation: 1595
I wanted to perform specific table formatting by removing left, right, inside horizontal and inside vertical borders. I have recorded a macro for this and got the following VBA code. I tried to make the same using C# , but I could not find there properties like wdBorderLeft
, wdBorderRight
, wdBorderHorizontal
or wdBorderVertical
. Does anyone know how to perform the same method using C#. I would appreciate any help.
Thanks,
Sarah
Sub Macro6()
Selection.Borders(wdBorderLeft).LineStyle = wdLineStyleNone
Selection.Borders(wdBorderRight).LineStyle = wdLineStyleNone
Selection.Borders(wdBorderHorizontal).LineStyle = wdLineStyleNone
Selection.Borders(wdBorderVertical).LineStyle = wdLineStyleNone
End Sub`
Upvotes: 2
Views: 7277
Reputation: 33
Another thing that you could do with the Interop.Word is simple disable the borders from your table, ie:
Table.Borders.Enable = 0;
That gets rid of everything in one simple line.
Upvotes: 2
Reputation: 957
I think the answer may be on this page: http://msdn.microsoft.com/en-us/library/aa942955%28VS.80%29.aspx.
Add: using Word = Microsoft.Office.Interop.Word;
Then use: newTable.Borders(Word.WdBorderType.wdBorderLeft)
etc.
Upvotes: 3