on-internet
← Community

How can I insert image and text into a Microsoft Word template?

Stack Overflow ·

Below code with spire.doc 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"); How can I insert image and text into certain positions in a Word template using either the spire.doc or

Comments

Sign in or sign up to comment and upvote.

No comments yet.