Repository.Profile.AddProfile

From ReliaWiki
Jump to navigation Jump to search
APIWiki.png


Member of: SynthesisAPI.Repository


Adds a new profile resource to the current project. Returns a Boolean value; when true, indicates a successful save.


Syntax

.Profile.AddProfile(Profile)

Parameters

Profile

Required. The cProfile object that represents the profile to be added.


Example

This example creates a new profile and then saves it in the first available project in 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")
 
 'Create a new profile. 
  Dim NewProfile As New cProfile
  NewProfile.Name = "MyNewProfile"

 'Add the new profile to project #1. 
  MyRepository.Project.SetCurrentProject(1)   
  Call MyRepository.Profile.AddProfile(NewProfile)
VB.NET

 'Declare a new Repository object and connect to a Synthesis repository. 
  Dim MyRepository As New Repository
  MyRepository.ConnectToAccessRepository("C:\RSRepository1.rsr11")
 
 'Create a new profile. 
  Dim NewProfile As New cProfile ("MyNewProfile")

 'Add the new profile to project #1. 
  MyRepository.Project.SetCurrentProject(1)   
  MyRepository.Profile.AddProfile(NewProfile)