Repository.Profile.GetProfile: Difference between revisions
Jump to navigation
Jump to search
Kate Racaza (talk | contribs) mNo edit summary |
Kate Racaza (talk | contribs) No edit summary |
||
Line 40: | Line 40: | ||
{{APIComment|'Get profile #1 from project #1.}} | {{APIComment|'Get profile #1 from project #1.}} | ||
{{APIPrefix|Dim}} MyProfile {{APIPrefix|As}} cProfile | {{APIPrefix|Dim}} MyProfile {{APIPrefix|As}} SynthesisAPI.cProfile | ||
MyRepository.Project.SetCurrentProject(1) | MyRepository.Project.SetCurrentProject(1) | ||
MyProfile = MyRepository.Profile.GetProfile(1) | MyProfile = MyRepository.Profile.GetProfile(1) |
Revision as of 17:28, 4 October 2016
Member of: SynthesisAPI.Repository Template:InProgress
Returns a cProfile object that represents a given profile resource in the current project. Returns nothing if the profile does not exist or is not in the current project.
Syntax
Profile.GetProfile(ID)
Parameters
ID
- Required. Integer. The ID number of the profile to retrieve.
Example
This example assumes that a profile with ID #1 exists in the first project of a Synthesis repository.
VBA 'Declare a new Repository object and connect to a Synthesis repository. Dim MyRepository As New Repository MyRepository.ConnectToAccessRepository("C:\RSRepository1.rsr11") 'Get profile #1 from project #1. Dim MyProfile As cProfile MyRepository.Project.SetCurrentProject(1) Set MyProfile = MyRepository.Profile.GetProfile(1) 'Output sample: Display the name and ID of the profile. Dim ProfileName As String Dim ProfileID As Integer ProfileName = MyProfile.Name ProfileID = MyProfile.ID MsgBox ("ID# " & ProfileID & ", " & ProfileName)
VB.NET 'Declare a new Repository object and connect to a Synthesis repository. Dim MyRepository As New Repository MyRepository.ConnectToAccessRepository("C:\RSRepository1.rsr11") 'Get profile #1 from project #1. Dim MyProfile As SynthesisAPI.cProfile MyRepository.Project.SetCurrentProject(1) MyProfile = MyRepository.Profile.GetProfile(1) 'Output sample: Display the name and ID of the profile. Dim ProfileName As String Dim ProfileID As Integer ProfileName = MyProfile.Name ProfileID = MyProfile.ID MsgBox ("ID# " & ProfileID & ", " & ProfileName)