ProtectionTypes

<< Click to Display Table of Contents >>

 

ProtectionTypes

Link This property returns an object that allows configuring Protection Types by script. Protection Types are available on the Protections tab of the Power Configuration object. To use the object returned by this property at run time, users must deactivate the Power Configuration object before changing its properties, according to the next example.

Set pc = Application.GetObject("PowerConfiguration")
pc.Deactivate
Set p = pc.ProtectionTypes
MsgBox Typename(p) & " " & p.Count
p.AddProtection "New"
p.AddProtection "New", "NE", , 12
Set pt = p.AddProtection("New3", "NE3", "Super New 3", 123)
MsgBox Typename(p) & " " & p.Count
p.DeleteProtection "New2"
p.DeleteProtection "New3"
MsgBox Typename(p) & " " & p.Count
Dim s
s = ""
i = 1
For Each pt In p
  If s <> "" Then s = s & Chr(13)
  s = s & pt.Name & " (" & Typename(pt) & ") "
  s = s & pt.Acronym & " "
  s = s & pt.Caption & " "
  s = s & pt.Order
  If i > 23 Then pt.Name = "Name"
  pt.Acronym = i & "A"
  pt.Caption = "Description " & i
  pt.Order = i
  i = i + 1
Next
MsgBox s
pc.Activate

 

NOTE

Please check topic Protection Types for more information about the properties of the object returned by this property.

Was this page useful?