?
Solved

SharePoint 2010 Document Library Document Properties

Posted on 2012-03-23
13
Medium Priority
?
884 Views
Last Modified: 2013-06-04
I have a VSTO word add in that uploads  documents to a document library on a SharePoint 2010 site.  The document gets uploaded and the custom document properties which mirror the document library view columns indeed show the custom properties as uploaded.  All well and good.

However,  when I click the document on the list and launch word to edit the document,  making changes to the document custom properties and uploading.  These updated custom properties are not reflected on that document item.

I can see the properties that I modified from within Word/File/Info, but not on the updated list item.
0
Comment
Question by:Howard Bash
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 6
13 Comments
 
LVL 51

Expert Comment

by:Ted Bouskill
ID: 37760970
So the document meta properties are duplicated in the list columns?  If yes, then SharePoint will not synchronize the meta properties in the document with the list columns without additional programming.
0
 
LVL 1

Author Comment

by:Howard Bash
ID: 37761971
It does pick up the values on the initial add though?  They don't do update? That's a bummer.  So now I need to write some event listener code.  Do you have any snippets or links describing the objects I'll need to manipulate for this then?  

Seems to me if they do add the meta data values from the document on add only, this is an error in design.
0
 
LVL 1

Author Comment

by:Howard Bash
ID: 37762050
Here is what I see.  I upload the file the first time and the document set properties show up in the SharePoint list with their current values from the document meta properties.  On subsequent uploads the changed custom column values are not reflected in the list for this uploaded document update.

However,  if I open the list via windows explorer,  I can change the documents meta data in word and then drag the modified file onto the windows explorer I had openned and the updates meta data values appear in the SharePoint list.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:Howard Bash
ID: 37762796
I have started looking at build an event receiver for handling the updating of an item's meta data.  

Here are the hurdles:
Not generic.  It seems to require a list by name in the setup and so this would be a problem for a site where users create lists that need this behavior.  I wonder if instead of listening for an event on a list you could instead listen for an event on a content type and you make the list based on that content type as the only requirement for list creation by users.

I tried modifying properties in a receiver and the update failed.  Here is the code and the error:


public override void ItemUpdating(SPItemEventProperties properties)
       {
           try
           {
               if (properties.ListTitle == "MyList")
               {
                   properties.ListItem["Status"] = "Modified In Rcvr Server Code";
                   properties.ListItem["MyListName"] = "MyList";
                   properties.ListItem["MyNumber"] = "9";
                   properties.ListItem.Update();
               }
           }
           catch (Exception ex)
           {
               string msg = ex.Message.ToString();
           }

           finally
           {
               base.ItemUpdating(properties);
           }
       }


ERROR FOLLOWS:

"The file \"http://mybox/sites/mysandbox/MyList/Doc2.docx\" is locked for shared use by mybox\\administrator."
0
 
LVL 51

Expert Comment

by:Ted Bouskill
ID: 37763169
You are on the right path.  If you want a generic event it has to be a feature that deploys a content type.  The feature would then be installed per site, site collection or even web application as required.
0
 
LVL 1

Author Comment

by:Howard Bash
ID: 37793108
I am able to use a listener to get to the item property and change it.  However,  when I do changes the property,  it fires that event again.  Not a good thing.  I suppose I could introduce some semaphore(s) but there must be a better event to catch the item.  I have been looking at the updated and updating events.
0
 
LVL 51

Expert Comment

by:Ted Bouskill
ID: 37793656
Yes, you need to use the Updated or Updating event.
0
 
LVL 1

Author Comment

by:Howard Bash
ID: 37797275
The problem though is that when you update a property of the list item within the handler, the handler raises the event as well.
0
 
LVL 51

Expert Comment

by:Ted Bouskill
ID: 37799403
0
 
LVL 1

Author Comment

by:Howard Bash
ID: 37800589
There are some snippets there that sound interesting. Unfortunately,  it's not clear to me exactly where theses snippets go.  For me,  a tiny complete example works better than disconnected snippets whose placement is sometimes not obvious.

Reading that link,  you will find people saying it's great stuff and also where do I put the snippets.  I fall somewhere near that group.  If you can show a more complete (tiny) complete usage of the snippets, this would be much more useful to me.
0
 
LVL 51

Accepted Solution

by:
Ted Bouskill earned 2000 total points
ID: 37804629
0
 
LVL 1

Author Comment

by:Howard Bash
ID: 37892912
Yes I have.
0
 
LVL 51

Expert Comment

by:Ted Bouskill
ID: 37895500
Well as far as I can see all the details for the implementation are on that original solution.  I don't see anything that is missing.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to use the Send to Mail Recipient command. The instructions apply generally to Office 2007 and later versions, but Microsoft® Word 2013 was used for the specific steps and figures.  What is Send to Mail Recipient? Send…
A recent project that involved parsing Tableau Desktop and Server log files to extract reusable user queries for use in other systems. I chose to use PowerShell to gather the data, and SharePoint to present it...
This video shows the viewer how to set up and create Footnotes in their document. Click on the References tab: Select "Insert Footnote": Type in desired text:
This video shows and describes the main difference between both orientations in Microsoft Word. Viewers will understand when to use each orientation and how to get the most out of them.
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question