This method searches for documents according to the criteria you specify.
Visual Basic |
---|
Public Function SearchDocuments( _ ByVal bUseSearchScope As Boolean, _ ByVal bstrFolders As String, _ ByVal bIncludeSubFolders As Boolean, _ ByRef ListOfFoundDocuments As Variant, _ ByRef iNumDocsFound As Long, _ Optional ByVal varFileFilterOrText As Variant, _ Optional ByVal PropertyList As Variant, _ Optional ByVal ConditionList As Variant, _ Optional ByVal PropertyValueList As Variant, _ Optional ByVal varNumProps As Variant, _ Optional ByVal varCheckModified As Variant, _ Optional ByVal varNumberOfDays As Variant, _ Optional ByRef ListOfTitles As Variant, _ Optional ByRef ListOfSubjects As Variant, _ Optional ByRef ListOfModifiedDates As Variant _ ) As Long |
Option Infer On Imports System Imports System.Runtime.InteropServices Namespace Examples Friend Class Program <STAThread> Shared Sub Main(ByVal args() As String) Dim application As DesignManager.Application = Nothing Dim bUseSearchScope As Boolean = False Dim bstrFolders As String = Nothing Dim bIncludeSubFolders As Boolean = False Dim ListOfFoundDocuments As Object = Nothing Dim iNumDocsFound As Integer = 0 Dim varFileFilterOrText As String = Nothing Dim PropertyList = New Object(0){} Dim ConditionList = New Object(0){} Dim PropertyValueList = New Object(0){} Dim varNumProps As Integer = 0 Dim varCheckModified As Boolean = False Dim varNumberOfDays As Integer = 0 Dim ListOfTitles As Object = Nothing Dim ListOfSubjects As Object = Nothing Dim ListOfModifiedDates As Object = Nothing Dim returnValue As Long = 0 Try application = New DesignManager.Application() bUseSearchScope = True bstrFolders = "" bIncludeSubFolders = True 'varFileFilterOrText = "*.asm,*.par,*.psm,*.pwd,*.dft" varFileFilterOrText = "*.par" PropertyList(0) = "SEStatus" ConditionList(0) = "=" PropertyValueList(0) = "Available" varNumProps = 1 varCheckModified = False varNumberOfDays = 5 returnValue = application.SearchDocuments(bUseSearchScope, bstrFolders, bIncludeSubFolders, ListOfFoundDocuments, iNumDocsFound, varFileFilterOrText, PropertyList, ConditionList, PropertyValueList, varNumProps, varCheckModified, varNumberOfDays, ListOfTitles, ListOfSubjects, ListOfModifiedDates) Catch ex As System.Exception Console.WriteLine(ex) End Try End Sub End Class End Namespace
using System; using System.Runtime.InteropServices; namespace Examples { class Program { [STAThread] static void Main(string[] args) { DesignManager.Application application = null; bool bUseSearchScope = false; string bstrFolders = null; bool bIncludeSubFolders = false; object ListOfFoundDocuments = null; int iNumDocsFound = 0; string varFileFilterOrText = null; var PropertyList = new object[1]; var ConditionList = new object[1]; var PropertyValueList = new object[1]; int varNumProps = 0; bool varCheckModified = false; int varNumberOfDays = 0; object ListOfTitles = null; object ListOfSubjects = null; object ListOfModifiedDates = null; long returnValue = 0; try { application = new DesignManager.Application(); bUseSearchScope = true; bstrFolders = ""; bIncludeSubFolders = true; //varFileFilterOrText = "*.asm,*.par,*.psm,*.pwd,*.dft" varFileFilterOrText = "*.par"; PropertyList[0] = "SEStatus"; ConditionList[0] = "="; PropertyValueList[0] = "Available"; varNumProps = 1; varCheckModified = false; varNumberOfDays = 5; returnValue = application.SearchDocuments( bUseSearchScope, bstrFolders, bIncludeSubFolders, out ListOfFoundDocuments, out iNumDocsFound, varFileFilterOrText, PropertyList, ConditionList, PropertyValueList, varNumProps, varCheckModified, varNumberOfDays, out ListOfTitles, out ListOfSubjects, out ListOfModifiedDates); } catch (System.Exception ex) { Console.WriteLine(ex); } } } }