我已经使用下面的代码将图像添加到Addin中的MS Word标题中。如何在MS Word 2010 Addin的页脚中添加图像?
Globals.ThisAddIn.Application.ActiveWindow.ActivePane.View.SeekView = Word.WdSeekView.wdSeekCurrentPageHeader;
Microsoft.Office.Interop.Word.Shape logoCustom = null;
object oMissing = System.Reflection.Missing.Value;
object oFalse = false;
object oTrue = true;
String logoPath = @"C:\Users\Hasan\Desktop\headers_footers\wordtemplate\logo_wordtemplate_150dpi.jpg";
logoCustom = Globals.ThisAddIn.Application.Selection.HeaderFooter.Shapes.AddPicture(logoPath,
ref oFalse, ref oTrue, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing);
logoCustom.Select(ref oMissing);
logoCustom.WrapFormat.Type = Microsoft.Office.Interop.Word.WdWrapType.wdWrapNone;
logoCustom.Left = (float)Microsoft.Office.Interop.Word.WdShapePosition.wdShapeLeft;
Globals.ThisAddIn.Application.ActiveWindow.ActivePane.View.SeekView = Microsoft.Office.Interop.Word.WdSeekView.wdSeekMainDocument;
但是我遇到了在页脚中添加它的问题。
我粘贴上面的代码工作正常的标题,但我也想在页脚中添加图像。我怎么可以做到这一点 –