Click to Rate and Give Feedback
Community Content
In this section
Statistics Annotations (1)
Collapse All/Expand All Collapse All
DocumentId..::.FindUrlsById Method

Finds the URLs of a document and all of its versions with a specified Id.

Namespace:  Microsoft.Office.DocumentManagement
Assembly:  Microsoft.Office.DocumentManagement (in Microsoft.Office.DocumentManagement.dll)
Visual Basic (Declaration)
Public Shared Function FindUrlsById ( _
    site As SPSite, _
    docId As String _
) As String()
Visual Basic (Usage)
Dim site As SPSite
Dim docId As String
Dim returnValue As String()

returnValue = DocumentId.FindUrlsById(site, _
    docId)
C#
public static string[] FindUrlsById(
    SPSite site,
    string docId
)

Parameters

site
Type: Microsoft.SharePoint..::.SPSite
ID to search for.
docId
Type: System..::.String
SPSite object to search on.

Return Value

Type: array<System..::.String>[]()[]
Array of strings that represents the URLs of all versions of the document found with the specified DocumentId value.
ExceptionCondition
ArgumentNullException

The SPSite object value is set to nullNothingnullptra null reference (Nothing in Visual Basic).

An array of strings representing the URLs of all the versions of the document found with the specified Id. nullNothingnullptra null reference (Nothing in Visual Basic) and 0 length arrays mean no results were found.

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
What does "Urls of all Versions" mean?      Kobi L   |   Edit   |   Show History
It can't mean version history, or else FindUrlById wouldn't work ( https://gist.github.com/601848 ) - it specifically expects one url, and opens the SPItem to find the version Url.
I have an issue with two documents with the same Document-ID (docx file and a pptx file), and not sure it's related. The default document-id is link also misbehaving.
Under what circumstances can FindUrlsById return more than a single item?
Tags What's this?: Add a tag
Flag as ContentBug
Processing
© 2012 Microsoft. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker