Free Support Forum - aspose.com

How i insert image to header of word document in asp classac?

How i insert image to header of word document in asp classac?
This message was posted using Aspose.Live 2 Forum

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. Please see the following link to learn how to use Aspose.Words via COM:

http://www.aspose.com/documentation/.net-components/aspose.words-for-.net-and-java/use-aspose-words-for-net-via-com-interop.html

Here is code example, which shows how to insert an image into the primary header:

' Create a ComeHelper

Dim helper

Set helper = CreateObject("Aspose.Words.ComHelper")

' Open document

Dim doc

Set doc = helper.Open("C:\Temp\in.doc")

' Create DocumentBuilder.

Dim builder

Set builder = CreateObject("Aspose.Words.DocumentBuilder")

builder.Document = doc

' Move DocumentBuilder cursor into the header.

builder.MoveToHeaderFooter(1)

' Insert an image

builder.InsertImage_2("C:\Temp\test.jpg")

' Save output document

doc.Save("C:\Temp\out.doc")

Hope this helps.

Best regards.