XML Namespace questions - add "properties" under Quick Parts List

User avatar
Charles Kenyon
4StarLounger
Posts: 403
Joined: 10 Jan 2016, 15:56
Location: Madison, Wisconsin

XML Namespace questions - add "properties" under Quick Parts List

Post by Charles Kenyon »

I have been working with Greg Maxey on adding items to the list of Document Properties that appears under Quick Parts in the Ribbon versions of Word. (This is an exaggeration of my contribution. I have been trying to follow what he is doing, actually.) Note that these are not really document properties but are Mapped Content Controls.
Here is the Answers thread on this: https://answers.microsoft.com/en-us/mso ... 66eaa01f1d

His xml works to add three controls to the list, two of which he has even set validation rules for.
This is impressive.
00 deleteme 10.png
I am lost on the xml schema namespace. Greg is using

Code: Select all

<xsd:import namespace="https://TheAnchorage/UserDefinedProperties"/>
which apparently refers to a non-existent location.

I tried using

Code: Select all

<xsd:import namespace="http://AddBalance/UserDefinedProperties"/>
which does not exist. That also works.

Note, I substitute "http://AddBalance" wherever he has "https://TheAnchorage."

Greg distilled his code from a SharePoint document I posted that added such properties to the list.
https://www.dropbox.com/s/lbpix6naqj7nf ... .dotx?dl=0

Here is my post:
https://answers.microsoft.com/en-us/mso ... 632f182f3f

Greg is trying to figure out how to add a ComboBox control to this list "Hopefully someone will come along with the keys to the kingdom (and lift the veil form the dms namespace datetypes "base" structure)" ... "What I don't know is if that schema has definitions to insert a RichText CC, ComboBox, Picture, or Checkbox CC. If it does, I don't know what I would put here: base="dms:???????" to make that work.

"If that schema doesn't have definitions for those types mentioned above then I don't know if some smart guy or gal could edit it and create them? It seems like it should be possible, but I don't even know where that schema is or what it looks like (in whole)."

Anyone know of a documentation for the data types in the schema?
How to edit it or supplement it?
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 72002
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: XML Namespace questions - add "properties" under Quick Parts List

Post by HansV »

I'm afraid I don't know anything about this stuff... :sad:
Regards,
Hans

WebGenii
StarLounger
Posts: 55
Joined: 26 Jan 2010, 18:21

Re: XML Namespace questions - add "properties" under Quick Parts List

Post by WebGenii »

Synchronicity is amazing. I'm trying to figure out if mapped content controls become part of the document metadata. Nope I don't know about ComboBoxes, but I'll keep an eye out now

User avatar
Guessed
2StarLounger
Posts: 102
Joined: 04 Feb 2010, 22:44
Location: Melbourne Australia

Re: XML Namespace questions - add "properties" under Quick Parts List

Post by Guessed »

I think Greg has solved to ComboBoxes question now.

It was discussed in this thread https://answers.microsoft.com/en-us/mso ... f1d?page=1
Andrew Lockton
Melbourne Australia

WebGenii
StarLounger
Posts: 55
Joined: 26 Jan 2010, 18:21

Re: XML Namespace questions - add "properties" under Quick Parts List

Post by WebGenii »

Like a pirate I've plundered Greg's solution.*grin* But I've run into a gotcha - the .xsd file content causes an error in the document information panel. Any attempt to open the DIP causes an error message. I assume its because one of the referenced namespaces is a SharePoint namespace. And its entirely possible that I'm hitting this error because I am not using SharePoint. Has anyone else encountered this problem. Or a link that is not about doing this work in VSTO?

User avatar
Guessed
2StarLounger
Posts: 102
Joined: 04 Feb 2010, 22:44
Location: Melbourne Australia

Re: XML Namespace questions - add "properties" under Quick Parts List

Post by Guessed »

If you aren't using SharePoint, why have you used one of it's namespaces? Can you post your embedded xml and xsd files - I can test on a machine that does have Sharepoint access to verify if the error is due to you not having it.

I would expect the problem is more likely to be the validity of your xml - but I haven't seen the schema. Did you find a Microsoft schema to test your xml validity?
Andrew Lockton
Melbourne Australia

User avatar
Charles Kenyon
4StarLounger
Posts: 403
Joined: 10 Jan 2016, 15:56
Location: Madison, Wisconsin

Re: XML Namespace questions - add "properties" under Quick Parts List

Post by Charles Kenyon »

WebGenii wrote:
12 Apr 2021, 22:43
Like a pirate I've plundered Greg's solution.*grin* But I've run into a gotcha - the .xsd file content causes an error in the document information panel. Any attempt to open the DIP causes an error message. I assume its because one of the referenced namespaces is a SharePoint namespace. And its entirely possible that I'm hitting this error because I am not using SharePoint. Has anyone else encountered this problem. Or a link that is not about doing this work in VSTO?
I would recommend posting the question in Greg's thread on the Answers site or asking him through his website contact process.
Also, take Andrew's suggestion and post your xml and xsd files.

WebGenii
StarLounger
Posts: 55
Joined: 26 Jan 2010, 18:21

Re: XML Namespace questions - add "properties" under Quick Parts List

Post by WebGenii »

If you aren't using SharePoint, why have you used one of it's namespaces?
Well, the namespaces in Greg's example aren't obviously SharePoint. But I've found that the DIP changes to reference "Standard and SharePoint library properties" and this appears after the error (I've attached a screenshot of the error message).
Did you find a Microsoft schema to test your xml validity? Nope, I've been relying on Word to scold me. I'm at the start of my learning curve here, so any references are welcome.


The XML
<?xml version="1.0"?>
<p:properties xmlns:p="http://schemas.microsoft.com/office/200 ... properties" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<UserDefinedProperties>
<RadPAF xmlns="http://mytechgenie.ca/UserDefinedProperties"/>
</UserDefinedProperties>
</p:properties>

=====================
The XSD
<?xml version="1.0"?><ct:contentTypeSchema xmlns:ct="http://schemas.microsoft.com/office/200 ... ontentType" xmlns:ma="http://schemas.microsoft.com/office/200 ... Attributes">
<xsd:schema targetNamespace="http://schemas.microsoft.com/office/200 ... properties" ma:root="true" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:p="http://schemas.microsoft.com/office/200 ... properties" xmlns:ns2="http://mytechgenie.ca/UserDefinedProperties">
<xsd:import namespace="http://mytechgenie.ca/UserDefinedProperties"/>
<xsd:element name="properties">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="documentManagement">
<xsd:complexType>
<xsd:all>
<xsd:element ref="ns2:RadPAF" minOccurs="0"/>
</xsd:all>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<xsd:schema targetNamespace="http://mytechgenie.ca/UserDefinedProperties" elementFormDefault="qualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:dms="http://schemas.microsoft.com/office/200 ... ment/types">
<xsd:import namespace="http://schemas.microsoft.com/office/200 ... ment/types"/>
<xsd:element name="RadPAF" nillable="true" ma:displayName="RadPAF" ma:default="Enter RadPAF #" ma:hidden="false" ma:internalName="RadPAF" ma:readOnly="false">
<xsd:simpleType>
<xsd:restriction base="dms:Text">
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:schema>
</ct:contentTypeSchema>
You do not have the required permissions to view the files attached to this post.

User avatar
Guessed
2StarLounger
Posts: 102
Joined: 04 Feb 2010, 22:44
Location: Melbourne Australia

Re: XML Namespace questions - add "properties" under Quick Parts List

Post by Guessed »

I don't have a solution yet but am just adding to the body of knowledge here in the hope that someone else has time to solve this puzzle...

It appears that the Document Information Panel has been removed from Word 2016 - what version of Word are you using? Now instead of seeing it at the top of the window, we get the same info by going to View > Properties.
See https://searchexplained.com/document-in ... e-instead/ and https://techcommunity.microsoft.com/t5/ ... a-p/106615

I put your code into a test document and saw an subtle error in File > Info
2021-04-15_10-56-27.png
In Word 2016 using your xml files, going to View>Properties doesn't throw an overt error but takes me instead to the File > Info screen instead of showing me the Properties Pane like I see in Sharepoint infused files which do work as advertised.

I will do further exploring and may be able to find the missing piece of the puzzle by comparing my Sharepoint-sourced content with your sourced content.
You do not have the required permissions to view the files attached to this post.
Andrew Lockton
Melbourne Australia

User avatar
Charles Kenyon
4StarLounger
Posts: 403
Joined: 10 Jan 2016, 15:56
Location: Madison, Wisconsin

Re: XML Namespace questions - add "properties" under Quick Parts List

Post by Charles Kenyon »

Thank you Andrew,
Eventually, we will get this stuff figured out. Then Microsoft will change it without documentation.

WebGenii
StarLounger
Posts: 55
Joined: 26 Jan 2010, 18:21

Re: XML Namespace questions - add "properties" under Quick Parts List

Post by WebGenii »

Hmmm. For this project I am using Word 2013. The final template will be used with Word 2010/2013/2016. If it breaks, I’d like it to break gracefully.

WebGenii
StarLounger
Posts: 55
Joined: 26 Jan 2010, 18:21

Re: XML Namespace questions - add "properties" under Quick Parts List

Post by WebGenii »

Just another piece of the puzzle - the problem only seems to be triggered when I have applied a custom toolbar. Otherwise the code is perfectly happy.
Also regarding the contentTypeSchema
"3.5.2.1 Content Type Schemas Schema
Content Type Schemas define the general look and composition of UI elements presented in a Document Information Panel. Information in the content type schema is derived from a content type associated with documents on Windows SharePoint Services. A Content Type Schema is used in conjunction with a CustomXSN element (§3.5.4.1.1.2, customXsn) data to fully define the behaviours of the Document Information Panel"

From https://docs.microsoft.com/en-us/opensp ... f88c972219