VbaModuleCollection Class
Represents the collection of VbaModule.
public sealed class VbaModuleCollection : IEnumerable<VbaModule>, IEnumerable
Public NotInheritable Class VbaModuleCollection
Implements IEnumerable(Of VbaModule), IEnumerable
- Inheritance:
- System.ObjectVbaModuleCollection
Properties
Count
Gets the number of elements contained.
Property Value
- System.Int32
Item[Int32]
Gets the VbaModule at the specified index.
public VbaModule this[int index] { get; }
Public ReadOnly Property Item(index As Integer) As VbaModule
Parameters
index
- System.Int32
The zero-based index of the VbaModule to get.
Property Value
Item[String]
Gets the VbaModule with the given name.
public VbaModule this[string name] { get; }
Public ReadOnly Property Item(name As String) As VbaModule
Parameters
name
- System.String
Name of the VbaModule to get.
Property Value
Methods
Add(String)
Creates and returns a new VbaModule with the given name and with the type of Procedural.
Parameters
name
- System.String
Name of the returning VbaModule.
Returns
Add(String, VbaModuleType)
Creates and returns a new VbaModule with the given name and type.
If the given vbaModuleType
is Document, returning VbaModule will be bound to PresentationDocument.
public VbaModule Add(string name, VbaModuleType vbaModuleType)
Public Function Add(name As String, vbaModuleType As VbaModuleType) As VbaModule
Parameters
name
- System.String
Name of the returning VbaModule.
vbaModuleType
- VbaModuleType
Type of the returning VbaModule.
Returns
AddCopy(VbaModule)
Clones and returns a new VbaModule from the given module.
public VbaModule AddCopy(VbaModule vbaModule)
Public Function AddCopy(vbaModule As VbaModule) As VbaModule
Parameters
Returns
Clear()
Removes all items from the collection.
Contains(String)
Indicates whether this collection contains the VbaModule object with the specified name
.
Parameters
name
- System.String
The name of the module to locate.
Returns
- System.Boolean
true if the collection contains an item with the name
; otherwise, false.
GetEnumerator()
Returns an enumerator that iterates through the collection.
public IEnumerator<VbaModule> GetEnumerator()
Public Function GetEnumerator As IEnumerator(Of VbaModule)
Returns
- System.Collections.Generic.IEnumerator<VbaModule>
A System.Collections.Generic.IEnumerator<T> that can be used to iterate through the collection.
Remove(VbaModule)
Removes the given VbaModule.
Parameters
Remove(String)
Removes the VbaModule by name.
Parameters
name
- System.String
Name of the VbaModule contained in the collection.
RemoveAt(Int32)
Removes the VbaModule from the given index.
Parameters
index
- System.Int32
The index of the VbaModule that will be removed.
TryGet(String, out VbaModule)
Tries to get the VbaModule with the specified name
.
public bool TryGet(string name, out VbaModule vbaModule)
Public Function TryGet(name As String, ByRef vbaModule As VbaModule) As Boolean
Parameters
name
- System.String
Name of the VbaModule contained in the collection.
Returns
- System.Boolean
true if the collection contains an item with the name
; otherwise, false.