我正在使用 Word Automation 从我的应用程序创建一个文档,我需要在文档的页脚添加三个签名。这很容易,但是,让它们按我的意愿出现是行不通的。
这是我正在使用的代码:
//add initials to footer
if (oWordDoc.Sections.Count > 0) {
Range r = oWordDoc.Sections[1].Footers[WdHeaderFooterIndex.wdHeaderFooterPrimary].Range;
Object colapseDir = WdCollapseDirection.wdCollapseStart;
r.Collapse(ref colapseDir);
oWord.ActiveWindow.View.Type = WdViewType.wdPrintView;
oWord.ActiveWindow.ActivePane.View.SeekView = WdSeekView.wdSeekCurrentPageFooter;
oWord.Selection.TypeParagraph();
oWord.Selection.Paragraphs.Alignment = WdParagraphAlignment.wdAlignParagraphLeft;
oWord.ActiveWindow.Selection.Font.Name = "Arial";
oWord.ActiveWindow.Selection.Font.Size = 8;
if (!String.IsNullOrEmpty(plaintiffInitialFile)) {
r.InlineShapes.AddPicture(plaintiffInitialFile, ref oMissing, ref oTrue, ref oMissing);
}
oWord.ActiveWindow.Selection.TypeText("Plaintiff's Initals");
oWord.ActiveWindow.Selection.TypeText("\t");
if (!String.IsNullOrEmpty(plaintiffAttInitialFile)) {
r.InlineShapes.AddPicture(plaintiffAttInitialFile, ref oMissing, ref oTrue, ref oMissing);
}
oWord.ActiveWindow.Selection.TypeText("Plaintiff's Attorney's Initals");
oWord.ActiveWindow.Selection.TypeText("\t");
if (!String.IsNullOrEmpty(ekfgInitialFile)) {
r.InlineShapes.AddPicture(ekfgInitialFile, ref oMissing, ref oTrue, ref oMissing);
}
oWord.ActiveWindow.Selection.TypeText("EKFG's Initals");
}
这是它正在产生的内容(我添加了注释)
这就是我想要的
我需要做什么?