示例#1
0
 public VbaProjectRepository(Vbe.VBE environment)
 {
     if (null == environment)
     {
         throw new ArgumentNullException("environment");
     }
     _environment = environment.Clone() as Vbe.VBE;
 }
示例#2
0
 public void Dispose()
 {
     if (null != _environment)
     {
         _environment.Dispose();
         _environment = null;
     }
 }
示例#3
0
        public ProjectCollector(Vbe.VBE environment)
        {
            Result = new List <string>();
            var projects = environment.VBProjects;

            foreach (var item in projects)
            {
                Result.Add(item.Name);
            }
            projects.Dispose();
        }
示例#4
0
        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);
        }
示例#5
0
 public CommandBarButtons(Vbe.VBE application)
 {
     Create(application);
 }