1. 正确安装 WPS
2. 添加 COM 应用
3. 编写代码
dynamic wps;
Type type = Type.GetTypeFromProgID("KWps.Application");
wps = Activator.CreateInstance(type);
dynamic doc = wps.Documents.Open("C:\9.wps", Visible: false);
doc.ActiveWindow.ActivePane.View.SeekView =
Word.WdSeekView.wdSeekCurrentPageHeader; //激活页脚的编辑
doc.ActiveWindow.ActivePane.Selection.ParagraphFormat.Alignment
= Word.WdParagraphAlignment.wdAlignParagraphLeft;
doc.ActiveWindow.ActivePane.Selection.InlineShapes.AddPicture(@"
C:\1.jpg");
doc.Save();
doc.Close();
MessageBox.Show("OK");