public VbaProjectRepository(Vbe.VBE environment) { if (null == environment) { throw new ArgumentNullException("environment"); } _environment = environment.Clone() as Vbe.VBE; }
public void Dispose() { if (null != _environment) { _environment.Dispose(); _environment = null; } }
public ProjectCollector(Vbe.VBE environment) { Result = new List <string>(); var projects = environment.VBProjects; foreach (var item in projects) { Result.Add(item.Name); } projects.Dispose(); }
private void Create(Vbe.VBE application) { var commandBars = application.CommandBars; Office.CommandBar commandBar = commandBars.Add("Share code from file system", MsoBarPosition.msoBarTop, null, true); commandBar.Visible = true; Office.CommandBarButton exportButton = (Office.CommandBarButton)commandBar.Controls.Add(MsoControlType.msoControlButton, null, null, null, true); exportButton.Style = MsoButtonStyle.msoButtonIconAndCaption; exportButton.FaceId = 9; exportButton.Caption = "Export Vba Code Modules"; exportButton.Visible = true; exportButton.ClickEvent += ExportButton_ClickEvent; Office.CommandBarButton importButton = (Office.CommandBarButton)commandBar.Controls.Add(MsoControlType.msoControlButton, null, null, null, true); importButton.Style = MsoButtonStyle.msoButtonIconAndCaption; importButton.FaceId = 9; importButton.Caption = "Import Vba Code Modules"; importButton.Visible = true; importButton.ClickEvent += ImportButton_ClickEvent; commandBars.Dispose(false); }
public CommandBarButtons(Vbe.VBE application) { Create(application); }