This Specification Task inserts an image into a Word document to replace an existing shape that has a specific title.
Microsoft Office and DriveWorks Live running as a service through IIS
Services (IIS) do not have access to many applications, especially COM programs such as Microsoft Word and Excel.
When using DriveWorks Live and IIS please read the following articles for information on where to place this Task.
|Title||Changes the Title (not the name) of the Task.|
|Source File Name||File Name of the document to edit (Should be rooted or relative to the Specification Directory).
The Source File Name is the name of the document once it has been created by a Specification.
|Titles of Images||Pipebar (|) delimited list of titles of images to be replaced.
This is the Title given to the inserted shape (see Set Up below).
Naming a shape using Alt Text is supported for Excel and Word builds 1803 and earlier.
Naming a shape using Alt Text and Selection is supported for Excel and Word builds 1804 and newer.
|New Images File Names||Pipebar (|) delimited list of images to insert, in the order they are required to be inserted relative to titles (Must include Full File Paths, or paths relative to the parent file).|
|Show Word||Word Application will be visible if set to TRUE.|
|Extension for Saving File||Pipe-bar (|) delimited list of extensions to save the file as (e.g. .pdf|.xps|.txt).
The following extensions are supported for saving the file:
.pdf, .xps, .txt, .xml, .htm, .html, .docm, .doc, .docx, .dotm, .dot, .dotx, .rtf and .odt
The Replace Image task works by replacing a Shape in the document.
To create a shape in the master document, of the file that is to have the image replaced, follow the steps below:
|Step 1||In the master document...
Click the INSERT menu, select Shapes and select a rectangular shape to insert.
Draw the shape at the point the image is required to be.
The original Line, Effects and Text Box properties of the shape will be maintained.
Only the FILL property will be changed to Picture Fill when the image is replaced.
Shapes with rounded edges, thick borders etc. will be preserved when the image is inserted. Images will be cropped and scaled to suit the size and layout of the original shape.
|Step 2 - Using Selection, Shape Name (for Word build 1804 and newer that are original .docx files)|
|Step 2 - Using Alt Text (for Word build 1803 and older or are .doc files or .docx files that were originally .doc files)|
When this Task is added the properties are static. To be able to build rules on a static property see How To: Change A Static Property To A Dynamic Property.
|Property Name||Example Rule||Example Result||Meaning|
|Source File Name||DWSpecificationFullPath&"\QuoteMasterDoc.docx"||C:\MyDocuments\Project\QuoteMasterDoc.docx||This is the Full File Path location of the Word document to replace images for.|
|Titles Of Images||"LogoLocation"||LogoLocation||This is a pipebar (|) delimited list of Titles of images to be replaced. These are the Titles of the shapes that you have set Titles for using Alt Text.|
|New Images File Names||"C:\MyDocuments\MyPictures\Logo.JPG"||C:\MyDocuments\MyPictures\Logo.JPG||This is a pipebar (|) delimited list of images to insert, in the order they are required to be inserted relative to the Titles of the images order.|
|Show Word||TRUE||TRUE||TRUE will make the Word application visible. FALSE will not.|
|Extension For Saving File||".docx"||.docx||This will save the Word document as a docx file.|
This task supports Status Outputs. These can be used to perform different actions depending on what the status outcome of the task is. For more information see Status Outputs in the Task Node Outputs section of Specification Macros Task Node.
The status output navigation is as follows:
Success with Warnings
Failed (one of the following occurred)