Click or drag to resize

Bookmark.AddImage Method

Added an image from file to bookmark selection

Namespace:  SIC.OpenDocumentFormat.MSWord
Assembly:  SIC.OpenDocumentFormat (in SIC.OpenDocumentFormat.dll) Version: 19.1.23.1 (19.1.23.622)
Syntax
public void AddImage(
	string pImageFile,
	string pBookmarkName,
	string pStyle = "",
	bool pNewParagraph = false,
	double pWidth = 0,
	double pHeight = 0
)

Parameters

pImageFile
Type: System.String
Image file
pBookmarkName
Type: System.String
Bookmark name to adds image
pStyle (Optional)
Type: System.String
Style name (must exists)
pNewParagraph (Optional)
Type: System.Boolean
New paragraph after image
pWidth (Optional)
Type: System.Double
Width of image in centimetre
pHeight (Optional)
Type: System.Double
Height of image in centimetre
Remarks
Can parameter pWidth or parameter pHeight specify so will calculate image size automatic.

Examples
This example added a logo image into a bookmark
SIC.OpenDocumentFormat.MSWord.Document lDOC = new SIC.OpenDocumentFormat.MSWord.Document("Brief.doc");
lDOC.Bookmark.AddImage("Logo.emf", "bmkLogo", pWidth: 5.6);      // width in centimetre
lDOC.Close();
See Also