BaseExtensions can be used to insert or paste images. This feature is compatible in Word and PowerPoint.
Module is located here:
...\ModuleLibrary\BaseExtensions\01_nocontext_Tools\23_WP_imageTools.xml
<Cmd case="BaseExtensions:insert-image"/>
Description: Inserts an image from a specific path.
Parameter:
path
Type the path from which the image should be inserted. For instance:
<Cmd case="BaseExtensions:insert-image" path="X:\MarketingData\BusinessImages" />
We are also able to use %Username%
in the path. As an example, this will be handy if the command is used to insert a something where we need the user principal name as part of the path.
Inserting a SharePoint path is also possible. For example you can write path="https://skabelondesign.sharepoint.com/sites/OfficeExtensions/Shared
Documents/General/Test Images Folder/"
. This will open the specified SharePoint page in your explorer if have not specified af file in filename
.
filename
Optional name of image file. Can include environment variables. If inserted image is always named the same. Used for instance in signature insertion. Include file extension, i.e. ".png". Note that this can also be used in conjunction with the SharePoint path as mentioned above (currently only in Word).
imgFromPath
Define this to be true
if the command should first try to insert from content folder, then try specific filename and lastly open the file dialogue if none of the previous attempts yield an image insertion.
Images can also be inserted in shapes. When inserting an image in a shape, these parameters are great to be used:
fit
Define fit to be true
if you would like your image should fit the placeholder it is inserted into. If this is not used or defined to be false
, the image will be filled.
verticalAlignment
Define how the image should be aligned vertically in a placeholder when it is fitted, using top
, center
or bottom
. Default value is center
.
horizontalAlignment
Define how the image should be aligned horizontally in a placeholder when it is fitted, using left
, center
or right
. Default value is center
.
no_crop
Define to be true
if you would like to disable crop view for image.
wraptext
Optional. Can hold the following values: front
, behind
, none
, square
, through
, tight
or topbottom
. Default values is inline
.
cancelRest
If multiple commands are run after the insert-image
command, we are able to control whether these should run if the prompt with a folder is cancelled. Define this parameter to be true
, if the command should cancel the rest of the commands in the chain when the user clicks at "Cancel". Default value is false
where the command will still execute the rest of the commands even though the prompt is cancelled.
insertIntoCellCCAlways
Use this parameter to be able to target a content control inside a table inside a shape. If this parameter is set to be true
, the command inserts the image into the cell that the currently selected content control resides within. Note that the cell should contain nothing but the content control selected as it will be deleted. The cell cannot contain more than one content control.
<Cmd case="BaseExtensions:paste-image"/>
Description: Will paste the last copied image in clipboard.
Parameter: This command can take parameters fit
, no_crop
and wraptext
as laid out above.
Comments
0 comments
Article is closed for comments.