Document in use
I am trying to empty my trash bin, but I keep getting a message that says one of the documents in it is in use. It is not in use. What can I do to delete it?
Thanks, Denise
Try pressing (and holding) the option key as you choose Empty Trash.
Regards,
Barry
Similar Messages
-
Error creating document from using list using Document Template
Hi All,
I am trying to create a document from sharepoint list and upload it to a document library using item added and item updated event receiver methods. I can create metadata from list update in document library but unable to open the document. The error message
I get is "we're sorry. we can't open "Filename" because we found a problem with its contents. no error detail available". Please see the below code.
SPSecurity.RunWithElevatedPrivileges(delegate()
try
string TemplateUrl = string.Empty;
SPWeb web = properties.OpenWeb();
web.AllowUnsafeUpdates = true;
SPDocumentLibrary olist = web.Lists["NewLibList"] as SPDocumentLibrary;
String url = olist.RootFolder.ServerRelativeUrl.ToString();
SPFile file = null;
file = web.GetFile(olist.DocumentTemplateUrl);
if (file != null)
SPListItem oItems = properties.ListItem;
web.AllowUnsafeUpdates = true;
byte[] readStream = file.OpenBinary();
SPFile uploadedFile = olist.RootFolder.Files.Add("http://site/subsite/Libraryname/" + properties.ListItemId.ToString() + ".docx", readStream,
true);
SPListItem listitem = uploadedFile.Item;
listitem["Firstname"] = oItems["Firstname"];
listitem["Lastname"] = oItems["Lastname"];
if (uploadedFile.CheckOutType != SPFile.SPCheckOutType.None)
uploadedFile.CheckIn(string.Empty);
listitem.Update();
uploadedFile.Update();
web.AllowUnsafeUpdates = false;
catch (Exception ex)
EventLog.WriteEntry(EventLogName, ex.Message, EventLogEntryType.Error);Hi,
Please try to use the code below:
SPSecurity.RunWithElevatedPrivileges(delegate()
try
string TemplateUrl = string.Empty;
SPWeb web = properties.OpenWeb();
web.AllowUnsafeUpdates = true;
SPDocumentLibrary olist = web.Lists["NewLibList"] as SPDocumentLibrary;
String url = olist.RootFolder.ServerRelativeUrl.ToString();
SPFile file = null;
file = web.GetFile(olist.DocumentTemplateUrl);
if (file != null)
SPListItem oItems = properties.ListItem;
web.AllowUnsafeUpdates = true;
Stream readStream = file.OpenBinaryStream(); //file is SPFile type
SPFile uploadedFile = olist.RootFolder.Files.Add("http://site/subsite/Libraryname/" + properties.ListItemId.ToString() + ".docx", readStream, true);
uploadedFile.CheckOut();
SPListItem listitem = uploadedFile.Item;
listitem["Firstname"] = oItems["Firstname"];
listitem["Lastname"] = oItems["Lastname"];
listitem.Update();
uploadedFile.Update();
uploadedFile.CheckIn(string.Empty);
web.AllowUnsafeUpdates = false;
catch (Exception ex)
EventLog.WriteEntry(EventLogName, ex.Message, EventLogEntryType.Error);
If the issue still exists, I suggest you dubug your code and check whether line of code error.
Thanks,
Dennis Guo
TechNet Community Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
Dennis Guo
TechNet Community Support -
Hi All,
We have SharePoint Production server 2013 where users are complaining that they are not able to copy or move files from one document library to another document library using “Open with Explorer” functionality.
We tried to activate publishing features on production server but it did not work. We users reported following errors:
Copying files from one document library to another document library:
Tried to map the document libraries and still not get the error to copy files:
In our UAT environment we are able to copy and move folders from using “Open with Explorer” though.
We have tried to simulate in the UAT environment but could not reproduce the production environment.
Any pointers about this issue would be highly appertained.
Thanks in advance
Regards,
Aroh
Aroh ShuklaHi John and all,
One the newly created web applications that we created few days back and navigated to document library, clicked on “Open with Explorer”, we get this error.
We're having a problem opening this location in file explorer. Add this website to your trusted and try again.
We added to the trusted site in Internet Explorer for this web application, cleared the cache and open the site with same document library but still get the same above error.
However, another existing web application (In same the Farm) that we are troubleshooting at the moment, we are able click on “Open with Explorer”, login in credentials opens and we entered the details we are able to open the document
library and tried to follow these steps:
From Windows Explorer (using with Open with Explorer), tried to copy or move a files to
source document library.
From Windows Explorer moved this file to another destination document library and we got this error.
What we have to achieve is users should be able to copy files and folders using
Open with Explorer functionality. We don’t know why Open with Explorer
functionality not work working for our environment.
Are we doing something wrong?
We have referred to following websites.
we hope concepts of copying / Moving files are similar as SharePoint 2010. Our production environment is SharePoint 2013.
http://www.mcstech.net/blog/index.cfm/2012/1/4/SharePoint-2010-Moving-Documents-Between-Libraries https://andreakalli.wordpress.com/2014/01/28/moving-or-copying-files-and-folders-in-sharepoint/
Please advise us. Thank you.
Regards,
Aroh
Aroh Shukla -
Problem with Open document SSO using websphere.
Hi All,
I have a issue,
We configured AD SSO using websphere and its working fine but when we try to login to the open document SSO using websphere it prompting for login credentials.
Is there any steps needed for configure open document SSO using websphere.
We made all the changes in web.xml file for the Open Document ,same as in Infoview web.xml file.
When we launch the Open Document, it prompts for the login screen, we get username and passwd fields we do not get the authentication drop down,if we give the AD credentials , we get "Enterprise Authentication error" .We feel the default authentication mode is taken as "Enterprise".
We have made changes in the web.xml for open document to have authentication.dafault as "secWinAD", also ,for test purpose we made the authentication. visible as "true" but the changes were not taken, we have redeployed the war files.
Any one please help on this.
Environment Details-
BOBJ XI R3.1 SP2
Web Sphere 6.1.0.25 .
Thank you in advance.
Thanks & Regards,
Bill.The same settings in the infoviewapp web.xml must be applied on the opendocument web.xml. Also you must be on XI 3.1 FP1 or higher. There is currently an Edge issue being investigated.
Regards,
Tim -
Hello everyone,
Recently went in to the Genius bar to pay to fix some aesthetic physical damage on my 2010 Macbook (Applecare expired) and while I was there I asked about some slowness I'd been experiencing but couldn't explain. My helper recommended that I switch from Mavericks back to Mountain Lion due to the amount of memory required by Mavericks. I did that, and it did fix the slowness issue, but now I'm not able to open my saved documents or use Pages. May be affecting other applications too those just happen to be what I use most frequently.
When I try to open a document it says I need "a newer version of Pages" but I apparently cannot run the newer version of Pages because it says it requires 10.9 or later.
Help, please? I really need access to my documents.Try one of these programs. Then save in another format and attempt to open in Pages.
LibreOffice
OpenOffice
Office Alternatives - Free -
How can I create accurate decimal dimensions when creating a new document or using the art board in Illustrator CS6? When I type in a number with a decimal, it automatically rounds the number up.
For my part you are welcome, sdowers.
Unfortunately, the uncertainty arising from the rounding has been up several times here in this forum.
I just came to remember a warning that needs to be given:
The rounding of the representation of a numerical value may be harmless in itself, but if you use it for any operation that changes the value, such as multiplication or whatever, things will go wrong because the operation will be made on the basis of the rounded value instead of the true value. So, as in your first case in post #2, 39.625 rounded to 39.63 will become 79.26 instead of 79.25. -
Document Set Creation in document library using REST API in Sharepoint 2013
Hi,
I want to create the document set using REST API call. Currently i am able to create the folder and able to upload the files using REST API's in the document library. Is there any way we can pass the contentype name or Id and create the document set using
REST API call. We need to create the document set along with metadata and upload the files inside the document set.
I need to create the document set along with meta data column values using REST API. Please let me know how we can achieve this through REST API.
Thank you,
MylsamyHi,
According to your post, my understanding is that you wanted to create document set along with managed metadata fields.
The REST API does not currently support working with Managed Metadata or Taxonomy fields.
As a workaround, we can use the JavaScript Client Object Model.
Create document set using JavaScript Client Object Model.
http://blogs.msdn.com/b/mittals/archive/2013/04/03/how-to-create-a-document-set-in-sharepoint-2013-using-javascript-client-side-object-model-jsom.aspx
http://social.technet.microsoft.com/Forums/sharepoint/en-US/aacd96dc-0fb2-4f0d-ab4c-f94ce819e3ed/create-document-sets-with-javascript-com-sharepoint-2010
Set managed metadata field with JavaScript Client Object Model.
http://sharepoint.stackexchange.com/questions/95933/add-list-item-with-managed-metadata-field-through-jsom
http://sharepointfieldnotes.blogspot.com/2013/06/sharepoint-2013-code-tips-setting.html
Thanks,
Jason
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
Jason Guo
TechNet Community Support -
Download older version of a file from SharePoint Document Library using CSOM and 404 error
Hi,
I am trying to download previous versions including Major and Minor versions of documents from SharePoint Online using CSOM. I get 404 error when I try to download the file. I found several posts on various discussion forums where people are getting same
error but none of those have any solution/answer. Below is one of the threads and sample code I have tried that results in 404 error. If I use the link in browser directly, I am able to download the file. Also I am able to download the current version of file
using CSOM without any problem, it is only the older versions that give me 404 in CSOM.
http://qandasys.info/how-to-download-the-historical-file-version-content-using-csom/
public int GetStreamFromFile(string docid, string lib, string fileurl, ClientContext clientContext, int iuserid, string Version, bool isCurrrent)
if(!isCurrent)
List LibraryName = clientContext.Web.Lists.GetByTitle(lib);
clientContext.Load(LibraryName);
clientContext.ExecuteQuery();
CamlQuery camlQuery = new CamlQuery();
camlQuery.ViewXml = "" + fileurl +
Microsoft.SharePoint.Client.ListItemCollection collListItem = LibraryName.GetItems(camlQuery);
clientContext.Load(collListItem, items => items.Include(item => item.Id, item => item["FileLeafRef"], item => item["LinkFilename"],
item => item["FileRef"], item => item["File_x0020_Size"], item => item["DocIcon"], item => item.File.Versions));
//clientContext.Load(collListItem);
clientContext.ExecuteQuery();
foreach (Microsoft.SharePoint.Client.ListItem oListItem in collListItem)
//string fileurl1 = (string)oListItem["FileRef"];
//string filename = (string)oListItem["LinkFilename"];
foreach (FileVersion version in oListItem.File.Versions)
if (Version == version.VersionLabel)
//Added excutequery to get object one more time as per blog
//http://social.technet.microsoft.com/Forums/de-DE/sharepointdevelopmentprevious/thread/88a05256-8694-4e40-863d-6c77512e079b
clientContext.ExecuteQuery();
FileInformation fileInformation = ClientOM.File.OpenBinaryDirect(clientContext,version.Url);
bytesarr = ReadFully(fileInformation.Stream);
DarwaishHi,
According to your description,
I know you want to get older version of a file from SharePoint Document Library using Client Object Model.
The following code snippet for your reference:
public void GetVersions()
ClientContext clientContext = new ClientContext(“http://SPSite”);
Web site = clientContext.Web;
clientContext.Load(site);
clientContext.ExecuteQuery();
File file = site.GetFileByServerRelativeUrl(“/Shared Documents/mydocument.doc”);
clientContext.Load(file);
clientContext.ExecuteQuery();
ListItem currentItem = file.ListItemAllFields;
clientContext.Load(currentItem);
clientContext.ExecuteQuery();
FileVersionCollection versions = file.Versions;
clientContext.Load(versions);
clientContext.ExecuteQuery();
if (versions != null)
foreach(FileVersion _version in versions)
Console.WriteLine(“Version : {0}”,_version.VersionLabel);
More information:
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.file.versions.aspx
Best Regards,
Dennis Guo -
Windows 8.1 problem saving word 365 document by using Netdrive in NAS Synology
Hi Everyone,
I have Problem with Windows 8.1 to open or save word 365 document by using Netdrive in NAS Synology.
Please I Need your help asap.Hi,
In regarding of the issue, we need more information.
Do you meaning that you can't open the Word 2013 file in NAS Synology through network?
Does only one Word file occur the issue?
Does the Other file encounter the issue (Such as Excel file ,TXT file, Images)?
Do you download the Word file to local and check if it can be opened or saved?
Do you get some error message or error code?
Please try the following steps to check they are helpful:
Create a new Word file and open it in local disk to make sure Word 2013 work fine in local.
Check the network connection.
Check the account permission and security settings.
If the issue still exists, please give me more information, and upload the event log to do further research.
Regards,
George Zhao
TechNet Community Support -
I have pdf file with 500 pages created from AutoCad file. In all pages, I have different document numbers.The file is not editable in pdf. How to change all the document numbers using "Comment" feature? Any alternate method? alternate method? I have Adobe Acrobat X Pro and Windows -7 platform.
Yes, I just want to cover up all the pages for those particular area of document numbers.
Nothing sensitive about it. I just want to show the correct document numbers on all pages in print out.
So, I wanted to cover up by comments, but commenting on each page will be difficult. So, I wanted to comment the same on all pages. -
In Reply to : How to validate org.jdom.Document object using xsd: dvohra09
Hi All
I am creating org.jdom.Document object using constructor Document() and adding children using setRootElement(), setChildren() and addContent() methods. The children are objects of org.jdom.Element. If i want to validate the org.jdom.Document using xsd what i have to do. Thanks in anticipation.I tried the below code and it is always giving the
Parsing fatal error : The markup in the document preceding the root element must be well-formed.
But it is possible to validate the same Document object as right document after writing it onto xml file using XMLOutputter and parsing it using DOMParser
Thanks in anticipation
org.jdom.Document document;
String documentString=document.toString();
StringReader stringReader=new
StringReader(documentString);
SAXBuilder saxBuilder =new
SAXBuilder("org.apache.xerces.parsers.SAXParser",true);
saxBuilder.setFeature("http://xml.org/sax/features/vali
ation", true);
saxBuilder.setFeature("http://apache.org/xml/features/v
lidation/schema", true);
saxBuilder.setFeature("http://apache.org/xml/features/v
lidation/schema-full-checking", true);
//Set a error handler with
setErrorHandler(org.xml.sax.ErrorHandler errorHandler)
saxBuilder.build(stringReader); -
How to update managed metadata column for all file in document library using powershell
Hi,
How to update managed metadata column for all file in document library using powershell?
Any help on it.
Thanks & REgards
Poomani SankaranHi TanPart,
I have changed the code which you have give in order to get the files from SharePoint 2010 Foundation Document Library.But i am getting below error in powershell.
Property 'ListItemCollectionPosition' cannot be found on this object; make sure it exists and is settable.
Could you tell me which is the issues in it?
See the code below.
$web = Get-SPWeb http://ntmoss2010:9090/Site
$list = $web.Lists["DocLib"]
$query = New-Object Microsoft.SharePoint.SPQuery
$query.ViewAttributes = "Scope='Recursive'";
$query.RowLimit = 2000
$caml = '<Where><Contains><FieldRef Name="Title" /><Value Type="Text">Process Documents/Delivery</Value></Contains></Where>' +
'<OrderBy Override="TRUE"><FieldRef Name="ID"/></OrderBy>'
$query.Query = $caml
do
$listItems = $list.GetItems($query)
$spQuery.ListItemCollectionPosition = $listItems.ListItemCollectionPosition
foreach($item in $listItems)
#Cast to SPListItem to avoid ambiguous overload error
$spItem = [Microsoft.SharePoint.SPListItem]$item;
Write-Host $spItem.Title
while ($spQuery.ListItemCollectionPosition -ne $null)
Thanks & Regards
Poomani Sankaran -
Hi i am trying to add a new item and update existing field value in a document library with powershell
but i receive below error message.
PS C:\Users\spfarm> C:\Scripts\add.ps1
Exception calling "Update" with "0" argument(s): "To add an item to a document
library, use SPFileCollection.Add()"
At C:\Scripts\add.ps1:24 char:16
+ $newItem.Update <<<< ()
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
#Add SharePoint PowerShell Snapin which adds SharePoint specific cmdlets
Add-PSSnapin Microsoft.SharePoint.PowerShell -EA SilentlyContinue
#Variables that we are going to use for list editing
$webURL = "http://tspmcwfe:89"
$listName = "test"
#Get the SPWeb object and save it to a variable
$web = Get-SPWeb $webURL
#Get the SPList object to retrieve the "Demo List"
$list = $web.Lists[$listName]
#Create a new item
$newItem = $list.Items.Add()
#Add properties to this list item
$newItem["Title"] = "My second item!"
$newItem["Info"] = "s15"
#Update the object so it gets saved to the list
$newItem.Update()
$web.Dispose()
adilHi Adil,
Document Library is different from a normal list. The document library contains files inside it. You need to update the code to add a document to the library. Then you can get hold of the List Item represented by that file and update its properties. Here
is an example:
$WebURL = "http://aissp2013/sites/TestSite"
$DocLibName = "Docs"
$FilePath = "c:\blogs.txt"
# Get a variable that points to the folder
$Web = Get-SPWeb $WebURL
$List = $Web.GetFolder($DocLibName)
$Files = $List.Files
# Get just the name of the file from the whole path
$FileName = $FilePath.Substring($FilePath.LastIndexOf("\")+1)
# Load the file into a variable
$File= Get-ChildItem $FilePath
# Upload it to SharePoint
$spFile = $Files.Add($DocLibName +"/" + $FileName,$File.OpenRead(),$false)
$item = $spFile.Item
$item["Title"] = "New Title"
$item.Update()
$web.Dispose()
Blog | SharePoint Learnings CodePlex Tools |
Export Version History To Excel |
Autocomplete Lookup Field -
Material BOMs with document items using RCSBI010
Has anyone uploaded material BOMs with document items using RCSBI010? I set the item category to D, but receive an error in LSMW when I attempt to convert the data. The error specifies that the document items are not valid material numbers. They are not material numbers. They are document info records.
Found the problem. The document number was being mapped to BOM Component IDNRK instead of document number DOKNR.
-
Get/retreive managed metadata column value from Document Library using SharePoint 2013 JSOM
Hi,
I am trying to retrieve managed metadata column (NewsCategory) value in SharePoint 2013 Document library using JSOM.
I get "Object Object" rather than actual value.
I tried:-
var newsCat = item.get_item('NewsCategory');
alert(newsCat) //Displays [Object Object]
var newsCatLabel = newsCat.get_label();
var newsCatId = newsCat.get_termGuid();
But, I get the error "Object doesn't support property or method get_label()"
I also tried :-
var newsTags = item.get_item(' NewsCategory ');
for (var i = 0; i < newsTags.get_count() ; i++) {
var newsTag = newsTags.getItemAtIndex(i);
var newsTagLabel = newsTag.get_label();
var newsTagId = newsTag.get_termGuid();
Even now I get the error "Object doesn't support property or method get_count()"
I have included " NewsCategory " in the load request:- context.load(items, 'Include(File, NewsCategory)');
Any idea what the issue is? Do I have to add any *.js file using $.getScript?
I added following .js files
var scriptbase = _spPageContextInfo.webServerRelativeUrl + "/_layouts/15/";
$.getScript(scriptbase + "SP.Runtime.js", function () {
$.getScript(scriptbase + "SP.js", function () {
$.getScript(scriptbase + "SP.Core.js", function () {
Thanks in Advance,Hi Patrick,
I already added those references. I just pasted the parts of script snippet in my initial post. To avoid confusion I am pasting here complete script.
2.1.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var scriptbase = _spPageContextInfo.webServerRelativeUrl + "/_layouts/15/";
$.getScript(scriptbase + "SP.Runtime.js", function () {
$.getScript(scriptbase + "SP.js", function () {
$.getScript(scriptbase + "SP.Core.js", function () {
function getdata() {
var context = new SP.ClientContext.get_current();
var web = context.get_web();
var list = web.get_lists().getByTitle('Documents');
var camlQuery = new SP.CamlQuery();
var filterCategory = 'Solutions';
var IDfromTaxonomyHiddenList = 15;
camlQuery.set_viewXml('<View><Query><Where><Eq><FieldRef LookupId="TRUE" Name="'+filterCategory+'" /><Value Type="ID">' + IDfromTaxonomyHiddenList +'</Value></Eq></Where></Query></View>');
/*the above CAML query successfully gets all the list items matching the criteria including "NewsCategory" managed metadata column values
But when I try to display the value it retrieved it ouputs/emits Object Object rather than actual values */
var items = list.getItems(camlQuery);
context.load(items, 'Include(File,NewsCategory)');
context.executeQueryAsync(
Function.createDelegate(this, function (sender, args) {
if (items.get_count() > 0) {
var listItemEnumerator = items.getEnumerator();
while (listItemEnumerator.moveNext()) {
var oListItem = listItemEnumerator.get_current();
var file = oListItem.get_file();
var name = file.get_name();
var newsCat = oListItem.get_item('NewsCategory'); alert(newsTags.constructor.getName());
alert(newsCat) //Displays [Object Object]
var newsCatLabel = newsCat.get_label(); // Here it errors out with message "Object doesn't support property or method get_label()"
var newsCatId = newsCat.get_termGuid();
} //end while
}//end if
Function.createDelegate(this, function (sender, args) {
alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
ExecuteOrDelayUntilScriptLoaded(getdata, "SP.Core.js");
</script>
In the above script "var name = file.get_name(); " gets the exact file name.
But the line "var newsCat = item.get_item('NewsCategory');
alert(newsCat) //Displays [Object Object] rather than actual value.
Issue resolved replace "oListItem.get_item('NewsCategory');" with oListItem.get_item('NewsCategory').get_label();"
Thanks -
How to Search document by using Long text description contents in SAPEasy DMS
Hi,
How to Search document by using Long text description contents in SAPEasy DMS
Regards,
Shrikant ShindeHi Alfredo,
Thanks for reply..Will you please explain in brief what are the OCR program and workflow.
Will you please send me any docs on [email protected]
Thanks
shiv.
Maybe you are looking for
-
My old PC with my Itunes library died. I have attempted to authorize it's replacement but the store tells me I have reached my limit of five. I don't recall doing this so my guess is that and old dead Ipod as well as old dead PC's could be deauthor
-
I've run into a slight issue when suppressing Zeros in a standard report in BPC. I'm hoping others have run into this as well, it seems like there should be a solution (but I haven't run into any via the help or this forum). Here's the situation: I
-
How to get mp3s from the cd to my iPhone library in iTunes when I hook the phone up to my iMac
Always before I hook the iphone up to the imac and open up itunes it recognized the phone and synced. Then you click on the phone and you had a choice of "on this phone" and it would show the folders and songs on the phone. Now, when I hook it up it,
-
Slow respone while open Gallery and Application
I have Nokia X6 with lates software version of 20.0.0005. whenever i press Gallery or application, it doesnot respond at all, i have to exit out to main screen and then go back to gallery or application. If i select ringing tone as video and keep my
-
ChaRM: Customizing of Change Request (IBase/Component)
Hi! By creation of Change Request the value "IBase / Component" should be filled. The default values here are: "0" and "0". Has some one already customizng experience here? I would like to change the value to e.g. "1" and "314" (my productive IBase).