Document Properties under Quick Parts customization

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

Document Properties under Quick Parts customization

Post by Charles Kenyon »

Hello,

I have long been interested in the Document Properties that are under the Quick Parts menu in the Ribbon versions. These are built-in mapped content controls. I even wrote a page about it. http://addbalance.com/word/MappedControls.htm

Recently, I discovered that it is somehow possible to modify and supplement this list with additional custom document properties that are also mapped content controls. Again, they show up under the document properties list. I am very curious about this. Here is a link to a template that has such additional properties on that list.
https://1drv.ms/w/s!Av-f5kUz-sWxbHoiWR_ ... E?e=KEgRVE
00 deleteme 3.png
I wrote a question a couple of weeks ago about this on the MS Answers site and Doug Robbins has been some help. However, he has not been able to tell me how I can modify these. Here is a link to the question on the Answers site. https://answers.microsoft.com/en-us/mso ... 632f182f3f

Can anyone tell me how I can do this?
Can anyone point me to documentation on how these "special" document properties are set in Word?

Thank you.
You do not have the required permissions to view the files attached to this post.
Last edited by Charles Kenyon on 28 Oct 2019, 19:36, edited 1 time in total.

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

Re: Document Properties under Quick Parts customization

Post by HansV »

I'm afraid I don't know anything about this stuff. :sorry:

Have you tried contacting Greg Maxey about this? (There is an email link on the Contact tab of his website)
Best wishes,
Hans

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

Re: Document Properties under Quick Parts customization

Post by Charles Kenyon »

Yes. I did, about a week ago. No response yet.

User avatar
kdock
5StarLounger
Posts: 720
Joined: 21 Aug 2011, 21:01
Location: The beautiful hills of Western North Carolina

Re: Document Properties under Quick Parts customization

Post by kdock »

Charles, I've created several form documents with mappable properties for my clients by using the XML Mapping Pane on the Developer ribbon. I create a new, unique document part with my mappable properties. I rarely use the built-in document properties since I don't want to interfere with anyone else who might be using them.

So, that being the case, I never wondered where they were in the XML. After experimenting, it looks as if they are not added to the XML until a user adds one to the document. I searched the XML of a docx file and found that some of the "core" properties were saved in the docprop/core.xlm part--"title" "subject" "keywords".... Not all, though, and a search for "abstract" and "status" turned up nothing in that or any other xml part visible to me.

So I added those Quick Parts to my experimental document and only then found them in the document.xml part.

In looking through the linked document, I saw several additional XML parts, such as metatdata/contentType and metadata/properties. I think these were inherited and/or created via SharePoint. Here's a screenshot of the XML parts in the template:
sharepoint xml parts.jpg
Have you tried manipulating document properties using the XML Pane?

Best, Kim
You do not have the required permissions to view the files attached to this post.
"Hmm. What does this button do?" Said everyone before being ejected from a car, blown up, or deleting all the data from the mainframe.

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

Re: Document Properties under Quick Parts customization

Post by Charles Kenyon »

Thank you Kim,

I haven't tried manipulating document properties using the XML pane. I can map content controls, I just can't get them to show up under Quick Parts > Document Properties. Do yours show up there?

I have also added custom document properties through code and through the interface, but those, also, do not show up under Quick parts (and are not mapped content controls).

I've discovered that the document with the extra properties is attached to the following additional schema:

http://schemas.microsoft.com/office/200 ... properties" onclick="window.open(this.href);return false;
That cannot be added through the XML dialog and results in an error message when used as an Internet address.
00 deleteme 1.png
00 deleteme 2.png
You do not have the required permissions to view the files attached to this post.
Last edited by Charles Kenyon on 12 Feb 2021, 07:59, edited 1 time in total.

User avatar
Jay Freedman
Microsoft MVP
Posts: 1313
Joined: 24 May 2013, 15:33
Location: Warminster, PA

Re: Document Properties under Quick Parts customization

Post by Jay Freedman »

I banged away on this for about an hour -- it sure would be nice if there was any decent documentation of the object model bits! Anyway, it seems to work.

This little macro adds a CustomXMLPart to the current document (it probably works the same for a template, but I haven't tried that yet) and then loads an external XML file with the desired nodes. You'll have to rename the attached .txt file to .xml, and change the path in the code to point to where you stored it.

Code: Select all

Sub AddCustomXMLPart()
    Dim part As CustomXMLPart
    Set part = ActiveDocument.CustomXMLParts.Add
    part.Load "D:\temp\CustomXMLpart.xml"
End Sub
Once you've done that, the XML Mapping Pane will see the schema and let you use the nodes from the XML file to insert content controls. (I've only added a few to show how nesting works.) The nodes are automatically mapped, so multiple controls from the same node repeat the data entered in any one of them.

There are probably many features of this that I haven't even seen yet. Let me know what you find!
You do not have the required permissions to view the files attached to this post.

User avatar
kdock
5StarLounger
Posts: 720
Joined: 21 Aug 2011, 21:01
Location: The beautiful hills of Western North Carolina

Re: Document Properties under Quick Parts customization

Post by kdock »

Charles, I thought I responded to your last post and find it's not here. Aye me.

No, my XML nodes do not appear in the document properties. I looked in the Datum file parts* and found the node "Command Line" (one of the Document Properties/XML nodes in the drop down to which you referred).
XML in Datum doc.jpg
It's in a heavily structured XML file, which may ultimately explain why it appears in Document Properties, while custom parts/nodes I've created through the XML Pane do not. I've never felt the need to have them there--I simply leave the XML Pane open. I pull nodes into my document directly from the XML Pane, but it's not a good user-facing process. It would be better for general use if they appeared in Document Properties.

Again, I'm of the opinion that these xml parts came from SharePoint. And by the way, when I make my custom part, the http:... didn't have to point at something real. :scratch: I pointed to my website and added "/CustomXML.htm" and custom mapping worked. I suspect it could be anything. I was starting to experiment with retrieving data from the nodes in one mapped document to inject into another identically mapped document when life intervened. I never got back to it, though it's an intriguing shortcut for groups of documents that repeat the same information.

It's been a while since I started using the XML Pane, and I must have gotten started learning what I know from elsewhere. Jay Freedman is right! There should be more documentation on this feature.

Best, Kim


* For those who have never done this and would like to take a peek behind the curtain, I downloaded the Datum.dotx file of Charles' OP (second link) to my desktop and changed the extension from .dotx to .zip. I then extracted the contents of the zip file to a folder on my desktop and then used File Explorer to open and view the XML files (turn the view pane on). To delve further, however, you might want a program like XML Notepad 2007.
You do not have the required permissions to view the files attached to this post.
"Hmm. What does this button do?" Said everyone before being ejected from a car, blown up, or deleting all the data from the mainframe.

User avatar
Jay Freedman
Microsoft MVP
Posts: 1313
Joined: 24 May 2013, 15:33
Location: Warminster, PA

Re: Document Properties under Quick Parts customization

Post by Jay Freedman »

I should have mentioned that the nodes added by my xml file also don't appear in the Document Properties list. :-(

I can see that I have something to occupy my time this weekend!

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

Re: Document Properties under Quick Parts customization

Post by Charles Kenyon »

I heard back from Greg Maxey after I resent them. (Turns out I was sending to an old email.)
He had seen this in another document a while back and has not been able to get it to work. Like me, trying to add another property zapped them all.

"As best I know, that is some of the black magic associated with interoperability with Word and InfoPath (now SharePoint) I believe. A few years ago when working with the Executive Office US Attorney’s Office, I came across a few documents and noticed some extra document properties. The guy I was working with told me it was a result of their use of the document at one time with InfoPath."

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

Re: Document Properties under Quick Parts customization

Post by Guessed »

Yes, you can add these fields by putting a document into a Sharepoint Library which is set up with custom site content type. This youtube video shows you the basic operation. https://www.youtube.com/watch?v=n2uHdf8ERd0

The result is that your documents end up with a couple of custom xml files added. One contains the xml element rules (the xsd information) and the other contains the actual values.

I haven't yet worked out how to do this without using Sharepoint to do the heavy lifting but it looks like it is possible.
Andrew Lockton
Melbourne Australia

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

Re: Document Properties under Quick Parts customization

Post by Charles Kenyon »

Well. I've downloaded SharePoint Designer. Have no idea whether I'll be able to use it. That may be my weekend project.
I'm sitting here now dressed in a vampire costume waiting for the neighborhood children to finish their candy raids.

User avatar
kdock
5StarLounger
Posts: 720
Joined: 21 Aug 2011, 21:01
Location: The beautiful hills of Western North Carolina

Re: Document Properties under Quick Parts customization

Post by kdock »

Charles, I'll be very interested to hear what you find. About SharePoint Designer. Though I'd love to see a photo of you in your vampire costume. Just sayin'.

Kim
"Hmm. What does this button do?" Said everyone before being ejected from a car, blown up, or deleting all the data from the mainframe.

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

Re: Document Properties under Quick Parts customization

Post by Charles Kenyon »

Looks like I need a SharePoint server to use Designer.
You do not have the required permissions to view the files attached to this post.

User avatar
kdock
5StarLounger
Posts: 720
Joined: 21 Aug 2011, 21:01
Location: The beautiful hills of Western North Carolina

Re: Document Properties under Quick Parts customization

Post by kdock »

Bummer. So it seems SharePoint Designer is there to help you design your SharePoint site.

As Guessed mentioned, those document properties are likely a result of saving a Word document to a SharePoint library, so the Document Properties in the screenshots you posted probably reflect the fields that pertain to the Word documents in the particular library in which they were saved.

If you open what I'm referring to as the Datum file and click the File tab, you'll see a list of many of the Document Properties that are visible through the Document Properties button on the Insert tab. Click "Show All Properties" and you'll see a very long list, indeed. Click Properties > Advanced Properties at the top of the list and you'll see that there are only six Custom Document Properties, none of which appear in the long list.

As Guessed also mentioned, without SharePoint to push those properties into the document, it still may be possible to add the properties by hand, or through code. And in order to do that, the Datum document could be a goldmine of information on the how. Doing it manually might lead to doing it through a VBA interface.

I find this a most intriguing mystery to solve. And thank you, Guessed, for the link to the SharePoint video.

Kim
"Hmm. What does this button do?" Said everyone before being ejected from a car, blown up, or deleting all the data from the mainframe.

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

Re: Document Properties under Quick Parts customization

Post by Charles Kenyon »

I had InfoPath with Office 2010 and am looking at that now.
That was short! Can't figure it out.

Am searching web for sharepoint designer without sharepoint.

User avatar
kdock
5StarLounger
Posts: 720
Joined: 21 Aug 2011, 21:01
Location: The beautiful hills of Western North Carolina

Re: Document Properties under Quick Parts customization

Post by kdock »

Oh that's right! I have it around here somewhere, but won't bother if it's inscrutable.

Good luck Googling. :crossfingers:
"Hmm. What does this button do?" Said everyone before being ejected from a car, blown up, or deleting all the data from the mainframe.

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

Re: Document Properties under Quick Parts customization

Post by Charles Kenyon »

Update: It is possible to add to the list without SharePoint, but is still a work in progress!

Grey Maxey has been tinkering!
See https://www.eileenslounge.com/viewtopic ... 26&t=36141 and https://answers.microsoft.com/en-us/mso ... 66eaa01f1d.