سؤال

center a word table

i am working with python and word application

i am trying to generate a table which will be in the middle of the page.

i tried something like this :

oWord.Selection.ParagraphFormat.Alignment = 
Word.WdParagraphAlignment.wdAlignParagraphCenter;

i had tried to assign it to 1 but it does not matter

oWord.Selection.ParagraphFormat.Alignment = 1

thank you for any help

هل كانت مفيدة؟

المحلول

 oWord.Tables[1].Range.ParagraphFormat.Alignment = WdParagraphAlignment.wdAlignParagraphCenter;

// Where Tables[1] means first table into your document. It Would definitely work

نصائح أخرى

Try recording a macro where you execute the ops you want and looking at resulting VB, this may then be easy to translate to python.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top