Click or drag to resize

BookmarkAddImage 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: SystemString
Image file
pBookmarkName
Type: SystemString
Bookmark name to adds image
pStyle (Optional)
Type: SystemString
Style name (must exists)
pNewParagraph (Optional)
Type: SystemBoolean
New paragraph after image
pWidth (Optional)
Type: SystemDouble
Width of image in centimetre
pHeight (Optional)
Type: SystemDouble
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