Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Unable to Generate Application Profile Document

SA-2040

Summary



A PRPC Developer is trying to use the 'Document Now' feature to document their PRPC Application: When pressing the 'Document Now' button; the button correctly gets disabled , but then nothing further happens; the button is never re-enabled. 

Error Messages



No Errors are present on the screen or in the logs.

STEPS TO REPRODUCE:

1. Log into DesignerStudio as the administrator of your Application* and select the following menu option:

DesignerStudio | Application | Tools | Document




2. From the 'Document Application' screen click the 'Document Now' button.







(*The option is not avaiable for PegaSample - a custom Application must be used for the test)



Root Cause



It was found that the host desktop was missing the following Registry Key:


HKCU:\SOFTWARE\Microsoft\Office\<MS OFFICE VERSION>\Common\General\Templates

Where '<MS OFFICE VERSION>' may be one of '11.0', '12.0', '14.0' and the 'Templates' Entry should be the localized name of the directory where Word Templates are stored; on English-Language locales, the value is simply 'Templates'.

This Registry key is checked by the SilverLight Control: and if the entry is missing from the Registry, the SilverLight Control will fail and the 'Document Now' button will not function.



Resolution



Ascertain which version of Microsoft Office is in-use; check which Locale is in operation and then based on that information, create the 'Templates' registry key (REG_SZ type) with appropriate value  - the localized name for 'Templates'.


HKCU:\SOFTWARE\Microsoft\Office\<MS OFFICE VERSION>\Common\General\Templates 

For English Language Locales : the 'Templates' key should just be set to the value of 'Templates'.

RECOMMENDED TROUBLESHOOTING STEPS:

To obtain DEBUG / ERROR messages from the SilverLight control used in the 'Document Now' feature; follow these steps:

 

  1. Perform a ‘Private Edit’ of the Section: “pzSilverLightWordMergeDocumentNow” (PegaAccel-Task-DocumentApp|pzSilverLightWordMergeDocumentNow| Pega-AppDefinition:07-10-09)

  2. At the end of the code in this rule, locate the input with id=”SLEvt” as shown below.


  3.  

         <input type="text" id="SlEvt" value="" size="100" style="display:none"/>

      3.  Modify this element, and remove the ‘display:none: styling ,  so that it now reads as follows: 

         <input type="text" id="SlEvt" value="" size="100" /> 



Save the rule: and re-run the test steps – you should now get a status box (bottom right) , which the SilverLight control will report messages to; as seen in this screenshot:




If you now see the following error message when running the 'Document Now' test:

//

SilverLight Control ERROR in 'sGetWordMacroDotPath': The system cannot find the file specified. (Error 0x1709.  Debugging resource strings are unavailable. See http://go.microsoft.com/fwlink/?linkid=106663&Version=5.1.30514.0&File=mscorrc.dll&Key=0x1709 0x80070002)
//

Then this is consistent with the missing Registry entry 'Templates'.

To check further ; run the following Microsoft PowerShell Script - which mimics the behaviour of the 'sGetWordMacroDotPath' method run by the SilverLight Control:

# NOTE: "Set-ExecutionPolicy RemoteSigned" may need to be run on client workstation before this script can be run.
#--- CUT HERE ---
clear-variable wordApp
clear-variable wordVersion
clear-variable text
clear-variable Regpath
clear-variable TemplName
clear-variable AppDataBase
clear-variable MacroPath

$wordApp=new-object -ComObject "Word.Application"
$wordVersion=$wordApp.Version.ToString()
$wordApp.Quit()
$text="Word Version:"+$wordVersion
echo $text
$Regpath="HKCU:\SOFTWARE\Microsoft\Office\"+$wordVersion+"\Common\General"
$text="Registry Path:"+$Regpath
echo $text
$RegProperty=get-itemproperty -Path $Regpath -name "Templates"
$TemplName=$RegProperty.Templates
$text="Localized Templates Folder name:"+$TemplName
echo $text
$AppDataBase=Get-Childitem env:APPDATA | %{ $_.Value }
$text="AppDataBase:"+$AppDataBase
echo $text
$MacroPath=$AppDataBase + "\Microsoft\"+ $TemplName + "\WordMacroManagerDot.dot"
$text="Calculated Macro Path as:"+$MacroPath
echo $text
# --- CUT HERE ---

The output of the script on a working system will be similar to the following:

//
Word Version:14.0
Registry Path:HKCU:\SOFTWARE\Microsoft\Office\14.0\Common\General
Localized Templates Folder name:Templates
AppDataBase:C:\Users\pritj\AppData\Roaming
Calculated Macro Path as:C:\Users\pritj\AppData\Roaming\Microsoft\Templates\WordMacroManagerDot.dot
//

If the 'Templates' registry is missing, then you instead you will see the following error instead:

//
Word Version:14.0
Registry Path:HKCU:\SOFTWARE\Microsoft\Office\14.0\Common\General
Get-ItemProperty : Property Templates does not exist at path HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\14.0\Common\General.
At D:\word-test.ps1:20 char:30
+ $RegProperty=get-itemproperty <<<<  -Path $Regpath -name "Templates"
    + CategoryInfo          : InvalidArgument: (Templates:String) [Get-ItemProperty], PSArgumentException
    + FullyQualifiedErrorId : System.Management.Automation.PSArgumentException,Microsoft.PowerShell.Commands.GetItemPropertyCommand

Localized Templates Folder name:
AppDataBase:C:\Users\pritj\AppData\Roaming
Calculated Macro Path as:C:\Users\pritj\AppData\Roaming\Microsoft\\WordMacroManagerDot.dot
//

Use 'Regedit' to double-check the path given by "Registry Path":





If the entry is missing, try creating it and re-running the Powershell script; if this runs without error - then re-try the 'Document Now' Feature.

 

Published January 31, 2016 - Updated October 8, 2020

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us