Moving from MZ-Tools 3.0 to 8.0 Part 30: Other minor features and enhancements

In this last post of the Moving from MZ-Tools 3.0 to 8.0 series, other minor features and enhancements will be mentioned:

The Autosave open documents feature allows you to save automatically the modified files periodically. It is configured in the Options window, Personal Options tab, Open Documents Autosaving section:


The Duplicate Current Line feature is present in many text editors and MZ-Tools 8.0 provides it too, although only through a keyboard shortcut:


The Default Properties feature can now be applied to a control on demand, not only when a control is added to a form:


And default properties can be applied to forms too, not only to controls:


The Open Build Output Folder feature adds a handy menu entry to a project in the Project Explorer to open the folder where the executable is generated:


The Sort Alphabetically Selected Lines feature is also handy in some scenarios, to sort lines of code.

For VBA, you have now a handy Export Files to export all the files of a VBA project to a folder.

In the Moving from MZ-Tools 3.0 to 8.0 series, we have seen all the new features and enhancements that were introduced after the MZ-Tools 3.0 version for VB6/VB5/VBA (released in October 2001) during many years in the versions 4.0, 5.0, 6.0 and 7.0 for Visual Studio, until the unified version 8.0 for all IDEs was released in October 2015. MZ-Tools 8.0 provides more features, allows more customization and flexibility, removes limitations of the version 3.0, improves the user interface, etc. with the goals of making you more productive and enhancing the quality of your projects. Thanks to the feedback received during all those years, it has become the great product that it is today.

Moving from MZ-Tools 3.0 to 8.0 Part 29: Copying files between projects

Sometimes you may need to copy files between projects. For that purpose, MZ-Tools 8.0 introduces a new feature, the Copy Selected Files to Folder, which appears on the Other Utilities toolbar or menu, and on the context menu of a file in the Project Explorer:


Once invoked, the feature allows you to select the destination folder:


To perform the reverse operation, MZ-Tools 3.0 already offered a way to add multiple files to a project, but only using the Ctrl+D keyboard shortcut assigned to the Add File built-in feature. MZ-Tools 8.0 offers a more intuitive way through a new “Add Multiple Files…” menu entry on the Project menu or context menu, along with the other “Add…” menu entries:


Moving from MZ-Tools 3.0 to 8.0 Part 28: The Switch Assignment

A new feature of MZ-Tools 8.0 is the Switch Assignment, a handy feature that allows you to swap the members of an assignment between variables. For example, suppose that you have a Person user-defined type with three fields (Id, FirstName and LastName) and a form with three textboxes. When you load the form, you want to show the values in the textboxes with this subroutine:


When the form is closed, you want to fill the user-defined type with the new values from the textboxes. You can copy the code from the previous subroutine:


And with the cursor on the first assignment you invoke the Switch Assignment feature:


Notice that the assignment has been swapped and the cursor has been moved to the next line, ready for a new operation. But you can select several assignments:


And swap all of them with one click:


So, the Switch Assignment feature can save time performing those mechanical operations, allowing you to become more productive.

Moving from MZ-Tools 3.0 to 8.0 Part 27: The Spell Checker

Another new feature of MZ-Tools 8.0 that wasn’t in MZ-Tools 3.0 is a spell checker for the Caption property of controls and for the text of MsgBox statements. The Spell Checker is configured in the Options window, Team Options tab, Quality Review > Spell Checker section, where you can specify the language and what to review:


It is part of the Quality Review feature:


The Spell Checker requires Microsoft Word (it uses automation behind the scenes). Its output uses the same results toolwindow than the other reviews:


With this new feature you can improve the quality of the user interface of your projects, ensuring that the texts shown to the user don’t have spelling errors.

Moving from MZ-Tools 3.0 to 8.0 Part 26: Converting multiple fields to properties

MZ-Tools 3.0 already offered a Convert Field to Property feature that allowed you to transform a public field of a class into a property. However, if you needed to convert multiple fields, you needed to do it one by one, which required extra clicks.

MZ-Tools 8.0, when converting a single field, works like MZ-Tools 3.0. You start by putting the cursor on the line of a field:


Then you invoke the Convert Field to Property feature to get a dialog to review the values:


And after clicking the Insert button you get the new code:


While the cursor is positioned on the next line to start a new cycle with the next field, MZ-Tools 8.0 allows you to select multiple fields:


And then, when invoking the Convert Field to Property dialog, notice in the caption that there will be several conversions:


And after clicking the Insert button several times you get the whole new code:


So, this is another area where MZ-Tools 8.0 can make you more productive saving extra clicks if you need to perform multiple field to property conversions.

Moving from MZ-Tools 3.0 to 8.0 Part 25: Private Clipboards enhancements

Another very used feature of MZ-Tools 3.0 that has been enhanced in MZ-Tools 8.0 are the Private Clipboards. Now you have “Copy To” and “Paste From” dropdowns on the Main toolbar, to provide better accessibility if you want to use the mouse instead of keyboard shortcuts:


The private clipboards are now editable so you can type anything; you don’t need to have code in a window to copy it to some private clipboard:


And since the private clipboards are editable, you can also clear their contents with the provided buttons at the bottom of the window, either individually or all of them at the same time.

With these minor enhancements this feature provides even more productivity and flexibility than the previous version 3.0, and along with the personal Code Library it can save you a lot of time when you need to repeat code.

MZ-Tools 8.0 Build released with bug fixes

A few hours ago the build was released, that fixes a few minor bugs, but an important one: in some VBA IDEs (such as Word 2016 and CorelDRAW X7), MZ-Tools hanged when loaded or when the VBA editor main window was activated.

The new build also introduces a minor enhancement useful if you use multiple IDEs at the same time, or use multiple monitors with floating toolwindows. Now, the Options window and the toolwindows show in the caption the IDE description (such as “Word 2010”, “Excel 2010”, etc.):



The complete changelog is the following:

MZ-Tools released (February 9, 2016)

  • Enhanced [#10644] (All): The Check for Updates feature now verifies that the downloaded file is not corrupted.
  • Enhanced [#10696] (All): The Options window and the toolwindows now show the IDE name.
  • Fixed [#10642] (All): The Download button of the Check for Updates dialog was not disabled during the download.
  • Fixed [#10645] (VB): The Smart Design Mode caused an error when trying to modify the Height property of a Combobox.
  • Fixed [#10645] (VB): The Smart Design Mode caused an error when trying to apply negative widths.
  • Fixed [#10396] (All): The Import button didn’t import a list of items from a regular Options .xml file in some cases.
  • Fixed [#10687] (VBA): The Name of a VBA project included always the file name. Now it doesn’t include it if the project name is not the default ‘VBAProject’ name.
  • Fixed [#10675] (VBA): The hyperlinks of the “Files” section of the HTML documentation (Filename and Type table) did not work correctly in VBA.
  • Fixed [#10697] (VBA): The VBA Editor for CorelDRAW X7 hangs when opened.
  • Fixed [#10485] (VBA): The VBA Editor for Word 2106 hangs when opened.
  • Fixed [Internal] (VB/VBA): The caption of the error handler editor has been changed from ‘Exception Handler’ to ‘Error Handler’.
  • Fixed [Internal] (VB): The Prompt Name and Caption dialog used the “Text” literal instead of the “Caption” literal.
  • Fixed [Internal] (VB): The Add Multiple Files menu entry on the Project menu was not added in the correct position.
  • Fixed [Internal] (All): The icon in the list of collection item conditions of the Programming Rules Review feature was not correct.
  • Fixed [Internal] (All): The Code Library didn’t import root or intermediate folders of code templates.
  • Fixed [Internal] (All): Localization typo in French.

Moving from MZ-Tools 3.0 to 8.0 Part 24: The enhanced New Method / Property Assistant

A popular feature of MZ-Tools 3.0 was the Add Procedure assistant, especially to generate properties. MZ-Tools 8.0 renames the feature to New Method / Property Assistant and provides quite a few enhancements.

To customize how a method is generated, use the Options window, Team Options tab, New Method / Property Assistant section, New Method tab, where you can define how you want to name the result variable for functions. The nomenclature can be a fixed value (such as “result”) or use type tags (such as “iResult” for integers, etc.). An example is shown in the preview zone:

NewMethodOptionsFor properties you use the New Property tab, where you can define the nomenclature for the field of the property and for the value parameter. Again, you can use predefined variables for type tags and for the name of the property, and an example is shown in the preview zone:

NewPropertyOptionsOnce configured, you can use the New Method / Property Assistant, which provides more options to customize the generated method and a live preview of the code:

NewMethodAnd for properties, you can specify the style (Standard vs Compact), whether to limit the access of the Let/Set member of the property, etc.:


With these enhancements, MZ-Tools 8.0 can accommodate better your coding style and nomenclature, and can make you more productive, showing a syntax-colored live preview of the resulting code to ensure that it meets your needs.

Moving from MZ-Tools 3.0 to 8.0 Part 23: Generating XML/HTML documentation

Another useful feature of MZ-Tools 3.0 that has been improved in MZ-Tools 8.0 has been the Generate XML / HTML Documentation. In MZ-Tools 3.0 the generated documentation was always XML, but if an XSLT file was specified inside the XML file, when opening it with a browser it was rendered as HTML.

The first improvement is that there are now two different buttons to generate XML and HTML documentation, so that trick is no longer required and you can have pure HTML documentation:

GenerateDocumentationButtonsThe XML documentation generation is configurable in the Options window, Team Options tab, XML Documentation section, where you can specify the output file encoding, whether to document only public declarations or not, and if you want to specify some executable for post-processing of the generated XML file. Furthermore, you can generate the XML documentation automatically, on any folder, when making a VB executable:

XmlDocumentationOptionsThe HTML documentation generation is also configurable in the Options window, Team Options tab, HTML Documentation section, where you can specify the XSL file to transform the XML documentation into HTML documentation. And, as it was the case with XML documentation, you can also generate the HTML documentation automatically when making a VB executable:

HtmlDocumentationOptionsAnother improvement that has been made in the HTML documentation is that now images are shown for different elements such as projects, properties, files, etc.:


With these enhancements, MZ-Tools 8.0 provides greater flexibility and productivity on how you want to generate the XML / HTML documentation of your projects so that the documentation is always in sync with the binaries.

Moving from MZ-Tools 3.0 to 8.0 Part 22: Reviewing the development environment settings

MZ-Tools 8.0 provides a new feature that allows a team lead to define the environment settings that should be standardized across all the computers of the team. For example:

  • The Windows OS must be 10.0
  • The VB6 IDE must have applied Service Pack 6.
  • The tab width must be 3 characters.
  • The Require Declaration setting is mandatory.
  • The Office version must be 2016.
  • The Office language must be US-English.
  • The source code control repository must have some URL.
  • Etc.

Then, each time that MZ-Tools 8.0 is loaded, it checks those settings and shows a warning to the developer if some setting is not the correct one. The settings are Registry-based, since Windows and Microsoft IDEs store the settings in the Windows registry. For example, VB6 stores its settings in this registry key:


While the VBA editor of Office uses this other one:


The development environment settings are defined in the Options window, Team Options tab, Development Environment Settings Review section:

DevelopmentEnvironmentSettingReviewsThat page allows you to create, edit, delete, activate or deactivate development environment setting reviews, and provides a handy “Run Active Reviews” button to check that they are correctly defined.

When you create a development environment setting review, you need to enter a description, the registry hive and key, a condition and a “How to fix” explanation for the developer:


When a development environment setting review fails, a dialog is shown to the developer, along with the procedure to fix it:


This feature is not only useful for teams, but also if you have more than one computer for development, or even if you need to format your only computer and want to have the same settings as before, provided that you have defined them previously and made a backup or you are using cloud based options.