Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What property defines the margin of a paragraph or table?

Tags:

c#

ms-word

com

I'm adding tables to a word document, and there seems to be an automatic margin that is applied to it. I can move it to the left manually when the word document is open, but I want to be able to do this automatically using my C# code.

enter image description here

How can I do this using com and C#?

like image 863
sooprise Avatar asked Mar 12 '12 17:03

sooprise


1 Answers

I usually find the best way to find the API method is to record a macro and look at the VB generated. Converting this to C# gives:

Selection.Tables(1).Rows.SetLeftIndent(5.4, RulerStyle.wdAdjustNone);

like image 73
79E09796 Avatar answered Oct 03 '22 16:10

79E09796