I want to insert the text in the center in my code. I cant able to do that. please help me here is my code
Document oWordDoc = Globals.ThisAddIn.Application.ActiveDocument;
Paragraph oPara1 = null;
var pText = oWordDoc.Paragraphs.Add();
pText.Format.SpaceAfter = 10f;
pText.Range.Font.Size = 12;
pText.Range.Font.Name = "TimesNewRoman";
pText.Range.Font.Bold = 1;
pText.Range.Text = String.Format("Table" + " " + (num).ToString() + " " + tabletext.Text);
pText.Range.InsertParagraphAfter();
this.Hide();

Amit GuptaRank #190 · 12.8K reputationPosted May 10, 2017, 9:12 PM EDT
chetan AllipurRank #2,527 · 554 reputationPosted May 10, 2017, 9:54 PM EDT
Amit GuptaRank #190 · 12.8K reputationPosted May 10, 2017, 10:20 PM EDT
chetan AllipurRank #2,527 · 554 reputationPosted May 10, 2017, 10:25 PM EDT
var pText = oWordDoc.Paragraphs.Add();
pText.Format.SpaceAfter = 10f;
pText.Range.Font.Size = 12;
pText.Range.Font.Name = "TimesNewRoman";
pText.Range.Font.Bold = 1;
pText.Range.Text = String.Format("Table" + " " + (num).ToString() + " " + tabletext.Text);
pText.Range.ParagraphFormat.Alignment = WdParagraphAlignment.wdAlignParagraphCenter;
pText.Range.InsertParagraphAfter();
this.Hide();