DOC TO EXE CONVERTER - DOCtoEXE
This utility converts Microsoft® Word files from original DOC formats (DOC, RTF, DOT, DOCM, DOCX, DOTM, DOTX) to EXE format (convert DOC to EXE, convert DOT to EXE, convert DOCM to EXE, convert Word to EXE). Like original DOC files, the EXE files created are not independent of Word, but they allow you to define Word properties before opening and improve the portability and functionality of your documents with or without macros and without macro alert, transferring EXE file properties to DOC files.
The conversion, moreover to maintain the original format features, inclusive for editing thru the Word, adds others functionalities where the autocompression and the control over the Word highlight. So, by be specialized in Word and VBA, can be more advantageous than ZIP files, ZIP autoextracts and program installation utilities. See below the EXE format features and then some pictures and applying examples.
EXE Format Features:
- Any Word DOC file format (*.doc; *.rtf; *.dot; *.docm; *.docx; *.dotm; *.dotx) can be converted to EXE;
Related to 'Word Version Options' frame in the UI:
- You can set the Word version to be used as the default installed version, a specific installed version, or a version of an Word EXE file indicated directly on the disk. (New in version 2.0 of 07/08/11)
- When specifying the default Word installed version to be used, you can limit the allowed versions, for example, if you limit the usable versions to 10 through 14, and the default installed version is version 9, then the EXE will not be opened on this version. (New in version 2.0 of 07/08/11)
- If you choose to use a version directly from an Word EXE file, you can specify the name and the path of the file on the disk or active drive. If you specify only the file name or the name with a partial path, in each execution the DOCtoEXE will automatically look for a satisfactory EXE completing the path, and immediately use the first and the closest possible option. (New in version 2.0 of 07/08/11)
- You can still allow the user to select an allowed version on the flight, if there is more than one installed, by holding down the Shift key while launching the EXE. The defined configuration is saved in an INI file next to the EXE to be used automatically in future executions, without holding down the Shift key. (New in version 2.0 of 07/08/11)
Related to 'Word Startup Options' frame in the UI:
- Can be opened in the Word without macro alert or with a custom alert (Good to work with known files containing macros using the Word in medium or high security level).
- Can be opened in an exclusive Word window (exclusive Word instance); it will refuse, while open, any attempt to share with an unfamiliar document, but accepts attached and new documents created during its execution. It also accepts documents with file names or full names set and passed in a list, as allowed or trusted by the VBA project at runtime (See Ex. 2). (Improved in version 2.0 of 07/08/11)
- Can be forced the closure of running Word instances at start up. This is helpful to use the EXE as an installer for a COM add-in.
- When opened in a separate instance, it can start Word in Automation mode, or very Automation mode; Word will thus run totally clean without STARTUPs, add-Ins, or COM add-ins. This is better than the /Automation Word command line switch that doesn’t disconnect COM add-ins. However, the disconnection is optional and, if you disconnect, you can list exceptions by ProgIds or by GUIDs. All the different versions of the same COM add-in have a single ProgId, and the GUID are different for each version, or more precisely for each DLL build. (Improved in version 2.0 of 07/08/11)
- When opened in a separate instance, it can control the Word window style (maximize, minimize, normal, or hidden). These four last features are good to be used when your document is a dictator application.
Related to 'EXE File Open Options' frame in the UI:
- Can show, without text size limit, an alert before opening in the Word (Good to installation alerts, copyright, guidance etc.).
- Can require password-to-open so safe that only can be cracked by attempts (brute force) same knowing the converter source code. Then, if you put a password and forget it, no-one, neither this utility author, can help you.
- All attached DOC files can be opened too at start and controlled as one whole like a 'work book' of documents
- Can avoid access to Visual Basic Editor (VBE) and prevent the design mode. (New in version 2.0 of 07/08/11)
- The handle of a window in Windows is passed to the VBA, so it can watch the EXE and take action when a program fails to run for some reason, for example, misuse of Ctrl+Alt+Del (See Ex. 2). (New in version 2.0 of 07/08/11)
Related to 'EXE File Save Options' frame in the UI:
- Can be read and write (Changes done in an EXE file opening in the Word to write are saved in the proper EXE file).
- Can be read-only, very read-only, doesn’t permit ‘Save’ and ‘Save as’ too.
- When saving changes, a series of backups can be created and specially indexed to form levels of backups, and therefore levels of restoration, at an amount that you choose and set. You can choose from the least 0 (no backup) to a maximum of 100 or even 101 for indefinable levels, making possible more restoration levels than when using the DOC format that supports one level or none. When you set levels of backups, at each new backup the existing ones are overwritten so that the most recent backup version is one of lower indexes or levels, while, if not set levels (101 option), existing backups are never overwritten and the most recent backups are the larger indexes. (Improved in version 2.0 of 07/08/11)
- Changes can be saved to a new DOC file, leaving the EXE unaltered (Good to be used like a template).
- Changes can be saved to multiple DOC files with an incrementing number (Good to be used like an invoice template).
- There are four levels of autocompression: none, normal (faster), medium (slower), and high (slower). Normal is equivalent to a normal zip file. This makes large files more portable, mainly when they need protection, because protected files in DOC format are of low compression. In a test with a simple document of 5 Mb, the ZIP compressed only 2% and this got 80% because the cryptography is done after the compression.
- An EXE file open for editing can update (save) itself automatically when closing and also before closing in three other ways. The first happens through the Word Document_BeforeSave event when changes are saved by the user in the converted DOC, or an attached DOC opens in Word. The second, looking periodically for changes saved in any type of attached file; the size of the period in minutes to look for is set when converting, if it set to 0, the program will never look for changes. The third, by a command activated via the VBA project using the lDOCtoEXE_SaveNow variable (See Ex. 2). (New in version 2.0 of 07/08/11)
- An alert that says “Please wait ..." is shown while EXE files are opened, closed, or saved. (New in version 2.0 of 07/08/11)
- You can avoid the original converted EXE file from being renamed. If it is renamed, it will not accept to open in Word while its original name is not restored.
Related to 'Limit Execution' popup frame in the UI:
- You can limit the EXE execution by date range based on the local system clock or Internet atomic clock (GMT) and/or conditioning to the registry of the installation with a serial and key specific to each system or computer. You must provide a password so that you (and only you) can possibly execute beyond the defined limits and also generate serials and get keys to register installations by commands available in the DOCtoEXE interface itself. Serials and keys are generated based on your password, then different passwords generate different serials and keys. Thus, only you or whoever has your password can generate valid serials and keys to your EXEs. It is a password so safe that it only can be cracked by attempts (brute force) same knowing the converter source code. Thus, if you put a password and forget it, no one, not even this utility author, can help you. No special access setting is required to limit with based on Internet atomic clock (GMT), the default setting set when you install the Internet browser is sufficient and usually necessary. (New in version 2.0 of 07/08/11)
Related to 'Setting...' popup frame in the UI:
- All the above features can be configured when you convert.
- The conversion can be done thru the utility interface or by command line.
- The command line can contain all of the options, alert text, and file names and paths to attach. You can generate long and complex command lines from the user interface and send them to the clipboard to be pasted anywhere, such as in an argument of VB or VBA Shell function or in the Windows Run dialog box.
- The converted EXE file also accepts command line and passes entirely to your VBA project.
- You can save in own file on disk all the settings set in a conversion to be used quickly in future conversions. If there is some kind of password in the setting, you will be asked to create a password to be required to open the file. Thus, only you or whoever has this password can open the setting file. It is a password so safe that it can only be cracked by attempts (brute force) same knowing the converter source code. Thus, if you put a password and forget it, no one, not even this utility author, can help you. (New in version 2.0 of 07/08/11)
Related to non-specific frame in the UI:
- The alert at the end of a successful conversion can be silenced with the option of maintaining (or not maintaining) a backup of the original converted DOC. (New in version 2.0 of 07/08/11)
- One or more text or binary files can be attached, as well as entire folders with all files and the tree of subfolders (Good to be used as installer file). (Improved in version 2.0 of 07/08/11)
- Some options defined in the conversion can still be changed at runtime via VBA project using predefined variables that swap information with the VBA project. These variables also make possible DOCtoEXE extra features and commands available only through the VBA project. In relation to the VBA project, their values or conditions can be read and/or write or read-only. See Ex. 2 how to use each of them in your VBA project. In all, DOCtoEXE provides 11 predefined variables described below:
1 - sDOCtoEXE_ThisDocPathExe (String, Read-only) - Name of the EXE file on the disk.
2 - sDOCtoEXE_ThisDocNameExe (String, Read-only) - Path where the EXE file is found on the disk.
3 - lDOCtoEXE_hWnd (Long, Somente leitura) - Handle of a window that DOCtoEXE created in Windows specially for the VBA project watches it and take action when it fails to run for some reason, for example, misuse of Ctrl+Alt+Del.
4 - lDOCtoEXE_AutoReopen (Long 1 or 2, Read and Write) - To DOCtoEXE auto reopen after all closed, set 1 for normal reopen or 2 for reopen asking privilege elevation. And, especially, 3 to quit the same way, but not reopen.
5 - lDOCtoEXE_WaitReopen (Long, Write) - Wait in seconds to auto reopen.
6 - sDOCtoEXE_CmdLineReopen (String, Read and Write) - Command line argument to be passed to the VBA project when opening or auto reopening.
7 - lDOCtoEXE_AvoidAccessVBE (Long 0, 1, or 2, Write) - Set as 1 to avoid access to VBE, 2 to allow, and 0 to follow the option set when converting. (New in version 2.0 of 07/08/11)
8 - lDOCtoEXE_SaveNow (Long 0 or 1, Write) - Set as 1 to DOCtoEXE save this project now. This useful when all data is saved in attached files. If the project is read-only or there is not to save, it will be ignored. (New in version 2.0 of 07/08/11)
9 - sDOCtoEXE_SaveAsExe (String, Write) - Set a full name for a new EXE file that will be created from the open EXE with the current changes by still to save. The current EXE will be closed without the changes and the new one will be open in its place already due saved. If the project is read-only, it will be ignored. (New in version 2.0 of 07/08/11)
10 - sDOCtoEXE_SaveCopyAsExe (String, Write) - Set a full name for a new EXE file that will be created from the open EXE with the current changes by still to save. The current EXE will continue open as it is and the new one will be closed duly saved with the changes. If the project is read-only, it will be ignored. (New in version 2.0 of 07/08/11)
11 - sDOCtoEXE_TrustDocNames (String, Write) - List of trusted document names (with or without path) for DOCtoEXE allows in exclusive window. Use ';' as separator. Path will be required on all names if there is at least one path separator character '\' on the list. (New in version 2.0 of 07/08/11)
- A converted EXE file that has in your name the text "Instl-", "-instl", "Runas-", or "-runas" in any position and form is always going to start asking for privilege elevation for Windows user account to administrator level. The EXE file can also be restarted automatically via VBA project to ask for elevation, making possible your VBA project start and work normally without administrator privileges, but with power to require elevation if necessary to execute some action or special feature (See Ex. 2).
- The EXE file can be closed and scheduled via VBA project to be reopened automatically after some time. In addition, a command line argument can be set to execute an action immediately and automatically after reopening (See Ex. 2).
- It provides for the VBA project the exe file properties as name, path, size and dates (See Ex. 2).
- You can convert back to DOC format using Word Save As command if not read-only.
- When convert, it creates a backup of the original DOC format file without overwriting previous one.
- Files in this format can function as EXE in CD Autorun.
- The conversion only adds about 223 kb which, depending on the file size, can be regained during autocompression.
- The converter and any converted files are standalone in the presence of the Office library, no extra library is necessary and neither changes in your Word or Windows setting.
Tested in Word for Windows, versions 97 (See Note), 2000, 2002(XP), 2003, 2007, 2010 (32 and 64-bit), and 2013 (32 and 64-bit) in MSI-based and Click-To-Run installations of Office 365™ cloud-based services.
You can see below three applying examples. The first is related with VBA developers, the second, with Word interface users and, the last, with Autorun CD:
1 – Some VBA developers have your proper utilities in DOC to install and uninstall their add-Ins and COM add-ins totally developed in VBA like all in my site. These DOCSs can be converted to EXEs to open directly on the Word. They open without macro alert regardless security level and still carry together the WLL, the DLL and any other necessary file. All in a single and compressed file.
All add-ins and COM add-ins for Word available on the site have their installers and uninstallers fully programmed in VBA in DOC files that are converted to EXE by DOCtoEXE, packaging still other necessary files:
2 – In the link below, the DOCtoEXE was used to convert to EXE a standard Word file, Document1.doc, where an Word user interface made a confidential report with links to some pictures files (bmp, gif, jpg etc.) and referring others Word documents that he/she would like to distribute jointly with Document1.doc without embedding in it but that is in a single, compressed, and protected file and with an opening alert.
Downloading this EXE format file and clicking in it, it’ll be open directly on the Word and you can change anything on it and save in the same way you’d do in a DOC format file:
Some advantages of the conversion in this example: opening alert, only links don’t become the Word document heavy, very well compressed although password protected, editable with all possible restoration levels, attached files are editable too, and exclusive Word instance in maximized window.
Specially for VBA developers, this document also contains ModDOCtoEXE standard module with minimal, necessary, and sufficient code for the VBA project to exchange information with the EXE at runtime. Complete examples with code in other modules and command buttons and descriptions in the spreadsheet illustrate how is done the exchange of each one of possible information. See then, via VBA project:
- How get EXE file properties: name, path, size, date-hour, if has administrator privilege, command-line argument, original xl file name, working temp folder, and Windows handle.
- How close an EXE setting to reopen automatically in some seconds after.
- How close an EXE setting to reopen automatically asking privilege elevation to administrator level on Windows.
- How close an EXE setting to reopen automatically with command line argument to execute an action immediately and automatically after reopening.
- How allow access to Visual Basic Editor (VBE) and design mode in an EXE that was converted using the "Avoid access VBE and design mode” option.
- How watch the EXE to take some action when it is no longer running due to some weird reason as, for example, the misuse of Ctrl+Alt+Del.
- How to Save Now an EXE directly without trigger of Word Workbook_BeforeSave events.
- How Save As another EXE.
- How Save Copy As another EXE.
- How trust and open a weird DOC in an EXE that was converted using the "Exclusive window” option.
3 - Suppose that you want to mount a CD that opens automatically your Word file of name MyApp.doc (The extension could be too DOT or RTF). Follow these three steps:
3.1 – Use DOCtoEXE to converter MyApp.doc to MyApp.EXE defining how you want the Word starting and attaching any necessary file
3.2 - On Windows Notepad, create and save a text file of name AUTORUN.INF with these two lines:
3.3 – Burn the CD with these files on the root:
Note: Optionally, to display on the Windows Explorer an own icon of your application, when the CD is inserted, add the following line at the AUTORUN.INF: ICON=MyApp.ico . The file MyApp.ico that can be created by an icon application like Microangelo (www.impactsoft.com) must be present too on the CD root.