With BaseExtensions we are able to load different Blank.potx presentations based on the value in a Document Property.
This command is intended to be run on a start up event.
It is also intended to be utilised alongside a Templafy setup, as this allows for a document property to be set based on selections in User Profile (see example further below).
Configuration
CMD
<Cmd case="BaseExtensions:blank-check-docprop" name="xx"/>The command will check the value of custom document property with a title matching the value defined in parameter name.
It will then print this value to this file (and spawn the file, if it does not already exist):
%AppData%\OfficeExtensions\User\Content\BaseExtensions\Blanks\config.jsonThe value inside will update each time command is run and detects a docprop matching the one defined in the parameter.
If, when command is run, it detects a match between the value in the config.json and a .potx file name located here:
Content\BaseExtensions\Blanks
It will open this file as a Blank presentation.
Example (3 steps)
Let's say a client needs load different Blanks based on the location of the user's office: one for Middle Eastern offices, one for Japanese offices and one for all other offices.
Step 1 - set docprop
First, we utilise native Templafy functionality to set a custom document property titled Location with the value of UserProfile.Office.Blank. The user input in the Office-dropdown, will convert to one of the following values: MiddleEast, Japan and Standard
Step 2 - place Blanks
Secondly, we place three different Blanks in the following folder of the SDUP:
Content\BaseExtensions\Blanks
The three Blanks will be named MiddleEast.potx, Japan.potx and Standard.potx.
Step 3 - module
We use the following module:
<event type="BaseExtensions:NewDocument">
<Cmd case="BaseExtensions:blank-check-docprop" name="Location"/>
<Cmd case="BaseExtensions:remove-doc-prop" name="Location"/>
</event>Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article