var doc = new Document();
doc.LoadFromFile(@"E:\test.docx", FileFormat.Doc);
var image = Image.FromFile(@"E:\nice.jpg");
var picture1 = doc.Sections[0].Paragraphs[0].AppendPicture(image);
picture1.VerticalAlignment = ShapeVerticalAlignment.Top;
picture1.HorizontalAlignment = ShapeHorizontalAlignment.Left;
picture1.TextWrappingStyle = TextWrappingStyle.Square;
doc.SaveToFile(@"..\..\result.doc", FileFormat.Doc);
System.Diagnostics.Process.Start(@"..\..\result.doc");
Как я могу вставить изображение и текст в определенные позиции в шаблоне слова, используя либо библиотеки spire.doc , либо Microsoft.office.interop.word библиотеки?>
[code]var doc = new Document(); doc.LoadFromFile(@"E:\test.docx", FileFormat.Doc); var image = Image.FromFile(@"E:\nice.jpg"); var picture1 = doc.Sections[0].Paragraphs[0].AppendPicture(image); picture1.VerticalAlignment = ShapeVerticalAlignment.Top; picture1.HorizontalAlignment = ShapeHorizontalAlignment.Left; picture1.TextWrappingStyle = TextWrappingStyle.Square; doc.SaveToFile(@"..\..\result.doc", FileFormat.Doc); System.Diagnostics.Process.Start(@"..\..\result.doc"); [/code]
Как я могу вставить изображение и текст в определенные позиции в шаблоне слова, используя либо библиотеки spire.doc , либо Microsoft.office.interop.word библиотеки?>