• Archive
  • Back to www.mscrm-addons.com
  • Archive
  • Back to www.mscrm-addons.com
home/Knowledge Base/Template Designer(DCP)

How to protect documents with a macro DocX

28 views 0

Written by Administrator
October 20, 2011

Protection for generated documents is a common query from our customers. With DocX and Macros it is very simple to achieve this.

Open the template, add the following Macro to the template and save it with the file extension .Docm.

Sub DCPMacro()
	ActiveDocument.Protect Password:="password", NoReset:=True, Type:=wdAllowOnlyReading, _     
           UseIRM:=False, EnforceStylelock:=False   
End Sub

This Macro will ensure that the created document is protected with a password.

The DCPMacro will be called after generating the document.

Other macros you could use are:

Macro-Namewhen will it will be called from the code
DocumentsCorePackMacroBeforeCreateActivity
this macro will be called before the activity is written to CRM
DocumentsCorePackMacroAfterCreate
this macro will be called after the activity is successfully created

Example:

If you want the Document Information Panel to be visible, you could add the following Macro (which will be executed before the activity is created and saved):

Sub DocumentsCorePackMacroBeforeCreateActivity()
    With Application
        .DisplayDocumentInformationPanel = Not .DisplayDocumentInformationPanel
    End With
End Sub

Here is an example template for the entity account:

DocumentInformationPanel.docm (26.02 kb)

That’s it! We appreciate your feedback! Please share your thoughts by sending an email to support@mscrm-addons.com.

 

reworkneeded

Was this helpful?

Yes  No
Related Articles
  • General Settings – DocumentsCorePack Server Based
  • How to use the Insert-as-Picture-Link-Field-button in Dynamics-365
  • How to use the Insert-as-Picture-Link-Field-button in Dynamics-365
  • Documents generated in Flows cannot be opened
  • How licenses are counted
  • How to setup editable sections in your template (Dynamics 365)
Latest Articles
  • The Local License Manager
  • TemplateImportExport Console Application – DCPIE.exe
  • How to trigger a Microsoft Flow from dialog
  • General Settings – DocumentsCorePack Server Based
  • How to use the Insert-as-Picture-Link-Field-button in Dynamics-365
Popular Articles
  • How to activate the DocumentsCorePack connector for PowerApps & Microsoft Flow
  • How licenses are counted
  • Where do I find the Unique Organization name in Microsoft Dynamics 365?
  • How to work with the new DocumentsCorePack custom connector for PowerAutomate (Microsoft Flow)
  • DocumentsCorePack Charts Feature (Dynamics 365)
Top Rated Articles
  • How to activate the DocumentsCorePack connector for PowerApps & Microsoft Flow
  • Can you save data capacity by moving email content?
  • Recap of the first virtual eXtreme365 & Community Summit event
  • Step-by-Step: How to configure a One-Click-Action
  • How to set up an email content service
Categories
  • *News and General Infos* 44
  • Template Designer(DCP 151
  • DocumentsCorePack(DCP 146
  • TelephoneIntegration (TI 62
  • AttachmentExtractor (AE 47
  • PowerSearch (PS 42
  • ActivityTools (AT 54
  • SmartBar (SB 49
  • GroupCalendar (GC 43
Our Vision

“We see it as our purpose to provide products that simplify and speed up our customers’ Microsoft Dynamics 365 experience.”

Knowledgebase
LogIn
mscrm-addons.com
  • Products
  • Online Shop
  • Downloads
  • My Account
About Us
  • About Us
  • Case Studies
  • Newsletter
  • Partner Program
  • Contact
Support
  • Support
  • Terms & Conditions
  • Documentation
  • Webinars
  • Legal Documents
  • Impressum
  • © 2020 www.mscrm-addons.com. All Rights Reserved.