PowerUser: How to Search by Document ID
PowerUser does not support searching by Document ID out-of-the-box. However, you can create a custom VBScript command to achieve the same functionality.
Below is a simple command. No properties are used, as we are not working with the current object but are instead trying to find a document when we know the Document ID. This script does not work in PowerWeb.
Sub FindDocumentwithID_Execute(Batch)
Dim DID, DName, DPath
DID = WinInputBox("Give document ID:","Query","<type here document id>")
'Recommended method to find document without big performance impact.
'Note! "Set" is required as no object defined here.
Set DName = Vault.GetDocument(DID)
If Not DName Is Nothing Then
'With Vault.FindDocuments according to VB guide, there's high performance impact. Note! "Set" for "DPath" is not required as there's object "DName" defined here
'DPath = Vault.FindDocuments().Document(DID).Path
'Recommended way (see above)
DPath = Vault.GetDocument(DID).Path
WinMsgBox("Document Name: "& DName & vbCrLf& "Document Path: "& DPath )
Else
WinMsgBox("Document with ID : '"& DID & "' was NOT found from the Vault")
EndIf
EndSub
How it looks in the user interface
The below screen shot displays how the command appears in the user interface. When you right-click, you see a command called Find Document with ID. If you select this command, you are prompted to enter the Document ID.
If the document is found, the script returns the document path.
If the document is not found, the script informs you that the document was not found.