Open File


' Get the Search service objekt
    Dim MySearchService As Service
    Set MySearchService = CATIA.GetSessionService("PLMSearch")

' Instantiate PLMSearch
    Dim MyPLMSearch 'As SearchService
    Set MyPLMSearch = MySearchService.Searches.Add

' Set type of object to query, a criterium and trigger
    MyPLMSearch.Type = "VPMReference"
    MyPLMSearch.AddAttributeCriteria "V_Name", MyFile

' retrieve the listed entities
    Dim MyPLMEntities As PLMEntities
    Set MyPLMEntities = MyPLMSearch.EditedContent

' get the PLMOpen and Open the first Doc
    Dim MyPLMOpenService As Service
    Set MyPLMOpenService = CATIA.GetSessionService("PLMOpenService")
    MyPLMOpenService.PLMOpen MyPLMEntities.Item(1), MyEditor