Class VbaModuleCollection
Contents
[
Hide
]VbaModuleCollection class
Represents a collection of VbaModule
objects.
public class VbaModuleCollection : ReadOnlyCollectionBase<VbaModule>
Properties
Name | Description |
---|---|
Count { get; } | |
Item { get; set; } |
Methods
Name | Description |
---|---|
Add(VbaModule) | |
GetEnumerator() | |
ToList() |
Examples
Shows how to iterate over VBA modules.
var project = new Project(DataDir + "VbaProject.mpp");
var vbaProject = project.VbaProject;
Console.WriteLine("Total Modules Count: " + vbaProject.Modules.Count);
foreach (var module in vbaProject.Modules)
{
Console.WriteLine("Module Name: " + module.Name);
Console.WriteLine("Source Code: " + module.SourceCode);
Console.WriteLine();
}
// the collection can be converted into a plain list
List<VbaModule> modules = vbaProject.Modules.ToList();
foreach (var unused in modules)
{
// work with modules
}
See Also
- class ReadOnlyCollectionBase<T>
- class VbaModule
- namespace Aspose.Tasks
- assembly Aspose.Tasks