Repository.Profile.UpdateProfile

From ReliaWiki
Jump to navigation Jump to search
APIWiki.png


Member of: SynthesisAPI.Repository


Updates the properties of a given profile resource in the current project. Returns a Boolean value; when true, indicates a successful update.

Syntax

.Profile.UpdateProfile(profile)

Parameters

profile

Required. The cProfile object that represents the profile resource to be updated.


Example

This example assumes that a profile with ID #1 exists in the first available project of a 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)

 'Change the profile's name to "New_Name." 
  MyProfile.Name = "New_Name"

 'Send the change to the Synthesis repository. 
  Call MyRepository.Profile.UpdateProfile(MyProfile)
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 cProfile
  MyRepository.Project.SetCurrentProject(1)  
  MyProfile = MyRepository.Profile.GetProfile(1)

 'Change the profile's name to "New_Name." 
  MyProfile.Name = "New_Name"

 'Send the change to the Synthesis repository. 
  MyRepository.Profile.UpdateProfile(MyProfile)