Issue
Symptoms
:
Users store .xltm
(or other macro enabled Excel files) in a SharePoint 2010 library. Go into Excel, and uncheck option Always show Document Information Panel on document open and initial save
. User should confirm the settings and close the file and then upload the file to the library. When the user downloads a copy of the file from this library, the document properties panel is still displayed, although the initial checkbox remain unchecked.
Solution
Cause
:
This is an expected behavior, since Always show Document Information Panel on document open and initial save for this content type
is not a Yes/No option. Furthermore, users have been able to reproduce the problem on the machine with macro enabled Office templates, if local copies are made of the documents in question. Also, having the escalation team check the code behind the involved applications, it can be confirmed that the default behavior is the following:
The OpenByDefault setting in the OpenXML file is read when users either have a custom xml part or if a custom DIP on a document library is being used.
For example, if a document information panel template in InfoPath is opened and publish it to a document library, when downloading documents user will indeed automatically have a reference to the custom DIP setting. It includes an OpenByDefault setting of False
by default so when opening this document locally it normally will not show the DIP any more.
For testing purposes, changed this setting to True
.
Now the DIP is always displayed when opening the local file.
So this setting does indeed make a difference. Therefore user can implement it in a workaround that can develop by the users or ask for support from the Microsoft Consulting Services.
In order to find and modify this option, need to publish a custom DIP template (xsn) to the document library first as mentioned above. Then will be able to locate the OpenByDefault option in the customxml\Item5.xml
file in the file .zip
structure.
Regarding the observation about templates and documents:
If a template is opened locally (e.g. a dotm) then there is the same behavior as with normal files (e.g. docm). So this is consistent.
If a locally downloaded template is double-clicked then Word (or other Office apps) will not open the template. It will create a new document based on this template. This code path is completely different.
If Word finds a WSS property reference in the template then it automatically opens the DIP when creating new documents.
Resolution
:
In Workbook_Open hide DIP after a delay:
In Workbook_Open() for ThisWorkbook:
private sub document_new()
Application.OnTime Now + TimeValue("00:00:01"), "On_Doc_Open"
end sub
In Module (Module 1 or Main) add a public function namens On_Doc_Open :
Public Sub On_Doc_Open() ActiveWorkbook.Application.DisplayDocumentInformationPanel = False
end Sub
Create a button to close the panel:
Use Selection Change
to hide DIP auf FALSE ( Similar to workaround 1 ): ThisWorkbook
select SheetSelectionChange Application.DisplayDocInfoPanel = False
For templates one could think about setting the OpenByDefault property in the OOXML stream to False
. In order to find and modify this option, user need to publish a custom DIP template (xsn) to the document library first as mentioned above. Then user will be able to locate the OpenByDefault option in the customxml\Item5.xml
file in the file .zip
structure:
True
True
If the OpenByDefault is changed to False
, then the DIP is not displayed when the document is opened.
This can be done outside of the Office applications with an external application, but user need to investigate how it would be implemented as there could be performance issues etc.
Alternatively, user could avoid template file formats in document libraries and store documents instead of templates there.
User may find the following public documentation useful: