Skip to content

Instantly share code, notes, and snippets.

@masazdream
Last active August 29, 2015 13:58
Show Gist options
  • Select an option

  • Save masazdream/10022219 to your computer and use it in GitHub Desktop.

Select an option

Save masazdream/10022219 to your computer and use it in GitHub Desktop.
// 通常の文字列
int para_cnt = document.Paragraphs.Count;
for (int para_index = 1; para_index <= para_cnt; para_index++)
{
Range rng = document.Paragraphs[para_index].Range;
document.Paragraphs[para_index].Format.BaseLineAlignment = WdBaselineAlignment.wdBaselineAlignCenter;
// 選択
rng.ParagraphFormat.Alignment = WdParagraphAlignment.wdAlignParagraphCenter;
rng.Select();
}
// 数式エディタで記載したオブジェクトがある場合
OMaths maths = document.OMaths;
foreach (OMath math in maths) {
math.ParentOMath.Justification = WdOMathJc.wdOMathJcCenterGroup;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment