.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Save and update selected item in document library using spfile?

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :C#




wasikhan junior software ENG

View Complete Post

More Related Resource Links

Multiline text field in document library and item update from Word trouble

Hi I have faced a bit of odd problem. Here is the scenario: I have document library with text columns (multiple lines of text) that are set to unlimited length. I have a workflow that runs with Word documents (.docx) that stores information in XML to this field. Everything works perfectly until document is edited in Word and saved back to document library. After Word saves my document in document library, the multiline text field is "cutted", only 7 rows of text is saved to my field. I have tried hiding my text field, making it sealed or readonly, but still Word breaks my field. Funniest thing is that when editing document in Word, this field should not have any changes (meaning that I dont show my "long text field" in document information panel back in Word). I have tried also creating event handler to handle itemupdating event in document library where I switch spweb.parserenabled property to false and in itemupdated event I switch it back on. Also I have tried to remove all line changes from XML with no luck. This XML saving to long text field works perfectly with many other places but in this one environment this does not seem to work :( I am looking forward to any suggestions what to try next. I have been wondering about using the eventhandlers and trying to "protect" my text field with some logic but that is still just a thought.   T

Non Mandatory Fields not allowing to save item in document library


Hi All,

I have 1 Document library where few fields/columns are NON MANDATORY, when i am trying to add new item in it, the fields which are non mandatory comes with Asterisk mark and not allowing to save any item in it.

how to automatically save new file into document library with a unique name or ID?

I've created a form using MS Word Document (2007) and lock it (protect it) so that users will be able to fill in the required fields.
then i've created a Content Type and uploaded the MS word form to be used as a template.

Then I've created a document library and enabled the content type and associate the above form for the library, so that when users click on New button the form will open.

everythings goes fine till here.

The problem is when users clicks on New and save the file back to the library, It doesn't save it with a unique name, instead it is over writting the existing one.
in other words, if employee 1 fill up the form and save it and later on employee 2 accessed the library and fill up a new form, he will overwrite what employee 1 has already saved!!

Is there a way to give every new created file a unique name? maybe (username+time)??

Can't save SQL Server Management Studio sql file back into Sharepoint Document Library

I created an sql query file in SQL Server Management Studio and saved it onto my hard drive.  I then moved that file into a Sharepoint Document Library so others on my team could use that query.I opened the file from within sharepoint, it launched SSMS.I made a change to the file and pressed save.here is the error message that comes up."The operation could not be completed.  The process cannot access the file because it is being used by another process"Am I doing something wrong?

Creating a new document in Document Library from custom menu item (in the ECB)

Hello! I created a custom menu item in the ECB for a document library. I'd like for this to create a new document from this menu item. Additionally, I'd like to create a workflow where the Title of the document from which the menu action originates is inserted into a custom textfield in the new document that is created. Is this possible using SharePoint Designer?

Item/Document permissions affect Library/List permissions

When I change the permissions on a item/document in a library/list the permissions are also changed on the library/list even though I stopped inheritance.  When I change the permissions on the library/list it also changes permissions on items/documents in that list even if inheritance is removed.

How to update selected item state in the list box by clicking a button?

I created a listbox menu to browse through content by clicking items in the listbox. I also created ‘back’ and ‘forward’ type of navigation to browse through the same content based on the browsing history. I load content into frame and accessing the browsing history with NavigationCommands.BrowseBack and BrowseForward Properties. It is working great. However, I need to indicate a selected state of the listbox item related to the content shown in the frame while browsing with Back/Forward buttons. I have a hard time binding that property. What is the correct way to bind selected state of the listitem in this case? Thank you in advance. XAML: Button <Button x:Name="NavBack" Content="" HorizontalAlignment="Left" Margin="20,0,0,0" Style="{DynamicResource BackButtonStyle}" VerticalAlignment="Top" CommandTarget="{Binding ElementName=ContentFrame}" Command="{x:Static NavigationCommands.BrowseBack}" SnapsToDevicePixels="True" IsEnabled="{Binding CanGoBack, ElementName=ContentFrame, Mode=OneWay}" > XAML: Listsbox <ListBox x:Name="Nav_ListBox" Margin="0,18,0,0" ScrollViewer.HorizontalScrollBarVisibility="Hidden" Background="#FFF2F2F2" ItemsSource="

Customizing Send To Other Location Functionality for a document library item in Moss 2007

Hi All i have a requirment to customize the Send To Other Location funtionality. while using OOTB Send to Other Location option for a document library item we have  selection like Prompt the author to send out updates when the document is checked in? <input id="ctl00_PlaceHolderMain_ctl01_ctl01_RadShouldUpdateYes" name="ctl00$PlaceHolderMain$ctl01$ctl01$ShouldUpdate" type="radio" value="RadShouldUpdateYes" /><label for="ctl00_PlaceHolderMain_ctl01_ctl01_RadShouldUpdateYes">Yes</label> <input id="ctl00_PlaceHolderMain_ctl01_ctl01_RadShouldUpdateNo" checked="checked" name="ctl00$PlaceHolderMain$ctl01$ctl01$ShouldUpdate" type="radio" value="RadShouldUpdateNo" /><label for="ctl00_PlaceHolderMain_ctl01_ctl01_RadShouldUpdateNo">No</label> how we can set this option in my custom coding based on the user selection. i am not able to understand the functionality of the above option. can any one please explain the above option and let me know how to set this option programmtically in my custom code.   Thanks in Advance  muthu

document library item viewer

Hi all, How we can make a document library item viewer? More like the document viewer. I have several file extension in a document library: eml, doc, and tiff. I want to put the viewer in the search result page. so when a user click 1 row it will show the item preview, no matter the extension.Best regards, -- Pingkan --

How to give access to SPFile which is NOT inside a document library?



I have a module in my SharePoint 2010 solution, the element.xml looks like this:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
 <Module Name="ModuleName" Url="

Excel fields linked to files in the document library do not update


We are having an issue with an Excel spreadsheet that is linked to several Excel documents in a document library.  Mutliple staff members update several "sub" spreadsheets with information that is rolled up to the "master" spreadsheet.  Excel appears to behave correctly in that if I open both the sub and master spreadsheets in my Excel window at the same time, the data in master gets updated.  If I just open the master, I have stale data.  I'm not sure SharePoint is to blame here, so I'll post this in the Excel forums as well, but any information or experience anyone has had with this would be fantastic.

Thanks in advance for any help/advice!

Can we Replace/Update/Overwrite uploaded document for an item in SP DocumentLibrary?


Hi all, I have a SP Document library item which is holding a document of type .Doc, now i want to Replace/Update/Overwrite the same SP DocumentLibrary's item with other type ex. .Pdf through Sharepoint ObjectModel. Can it be possible. If so can u share ur thoughts/code.

Best Regards, Srikanth Ch

Save generated xlsx file in document library


I have created a webpart that generates a xlsx fil with data from some lists on a sharepoint 2010 site using open xml 2.0.

So far I save the generated xlsx file on the servers harddrive just for test purpose. What I want is to save the generated xlsx file to a document library, but I feel it is a little stupid to save the file on the harddrive and afterwards upload it to the document library.

Can't I skip the "save on harddrive"-step somehow?




Default Column Values in a Document Library (SP2010) do not show up in word 2010 until you save and


when you create a document in a SP 2010 document library (of a particular content type, by clicking new, letter (content type name) in sharepoint for example) which has default values set on in in the library (set by using library settings -> change default column values), the default values do not show up until you create the document , save it and reopen it again.  Is this a bug or by design.  If it is by design, it is horrible since if some of the column default values are mandatory in the content type then you actually have to type them in before you could possibly save the file which defeats the whole point of having default column values.  Also it is tremendously clunky for a user to have to create file, save it , close it, and reopen it just to view the default metadata in the document information panel that is supposed to be there.

Anyone have any thoughts/solutions to this problem?


Not able save Documents into Document Library when connecting from Internet


Hi All,

I have created a Document Library in My portal. I am able to access, create and upload document when I am in connecting to the portal from my office (Intranet).

I am able to access the Document Library when I am connecting using Internet (external). But I am not able save Documents into Document Library. I am getting Below error Message.

"Documents in this folder are not available. The Folder May have been moved or deleted, or Network porblems may be preventing a connection to the server".

I am using Microsoft ISA as proxy server.

Please suggest me what might be wrong.


Outlook "Save as" in document library with all custom column


I want to put my Outlook 2007 email in my sharepoint document library (moss 2007).
To do that, I do "Save As" in Outlook. In "My Network Places" I put the url of my library.
Then, in some cases, my email is saved directly. And in other cases, outlook opens me the form to inform the different meta-data "web file properties" (
that's what I want) . it does not save the field values. It takes the default values of columns. Same required columns
Lire phonétiquement

However, in any case, the metadata are stored in sharepoint.

Do you use this method?
What configuration of my document library must have that outlook I am proposing to fill the metadata? (Docume

How to update iFrame source from twolistboxes on selected item value???


I have a two listboxes where I generate content from XML. I define UriSource in XML. I'd like to find out how I can update Frame's Source property from two different lisboxes. Any ideas are highly appreciated.


Listboxes and Frame:

<Grid x:Name="PANEL_BottomArea_Grid" DataContext="{Binding Source={StaticResource PagesData}}">


 				<ColumnDefinition Width="215"/>

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend