DOC CONVERTER FOR WORD97

INTRODUCTION

This word macro allows the conversion of:

Doc files (PRC or PDB Files) => Text files (TXT Files)
Word (.DOC) or Text files (TXT Files) => Doc files (PRC or PDB Files)

Also
Jfile (PRC or PDB Files) => csv text file (TXT Files)
MobileDB (PRC or PDB Files) => csv text file (TXT Files)

The ability to convert a Word document to a doc file and the reverse is something I’ve wanted for a while. I first got the idea of how to do it from Dave Mac (unsure of his web address), who wrote a fast, simple conversion program for Word. I’ve since written my own, adding few more tricks and moved it up to Word97 since I know more VBA than I do the Word macro language.

Limitations:

This program works only on Word97 running under Windows95/98. Sorry to everyone else.

New in this update:

Updated to support RichReader v1.4.
Files saved as .pdb instead of .prc (docs with the same name as an application overwrote the application when installed, this fix stops this happening).

New in Last update:

Category support for AportisDoc, TealDoc, SmartDoc and LinkDoc.
Conversion support for ToGo and RichReader (converters not included).
Ability to specify any directory as the default directory without requiring the converter to be present.
Easy swapping from more than one backup directory.
Ability to append various docs together in one text file (see Merging Docs in the manual).
Some conversion information held (doc title and path) for later use in converting back.
More error checking and fixes for known bugs.
Made the manual insanely bigger for what's meant to be an intuitive macro :).

INSTALLATION

There are five files required:

PalmDocConvert.dot Placed in C:\Docs (this can be changed later)
PalmDocConvert.dot.lnk Placed in C:\Program Files\Microsoft Office\Office\STARTUP
EAUSRDAT.dll Placed in C:\Windows\Systems
Makedoc.exe Placed in C:\Docs (this can be changed later)
jconv95.exe Placed in C:\Docs (this can be changed later)

Other files included:

MakeDocReadme.txt (about how makedoc.exe works)
jconv.txt (about how jconv95.exe works)
dll_readme.txt (about the dll for VB or VBA programmers who may want to use it)
Image1.gif and Image2.gif (the pictures in this document)

CONVERTING FILES

Open Palm

This button (no letter) will open the Palm/PalmPilot desktop.

Docs To Text

When the Docs To Text (P) button is pressed you are presented with the standard Word Open box looking for prc or pdb files. Selecting a file will convert the doc to a temporary text file, which will then be opened. To set the default directory shown when opened, see Text to Doc - Setup below.

If this button is pressed again while the temporary file is still opened you will be given the opportunity to delete the original prc/pdb file. This is handy for quickly reading newspaper downloads and removing them when finished.

If the text file is subsequently saved as a Word document (rename the file if you do this), the original prc/pdb Title and the location (where the prc/pdb file was when converted) are saved and used a defaults if the document is reconverted back to a prc/pdb file.

The file is checked that it is a doc file before conversion begins and a message displayed if not.

Text To Docs

When the Text To Docs (T) button is pressed you are presented with a part of the following box.

Document Title

This is the name of the database that appears in the Doc program on the Palm unit. This will default from the first line of the document being converted if that line is 30 characters or less. It will also remove any non alpha-numeric characters.

File Name (.prc)

This is the name of the file that will be created by the conversion. An extension of .Prc will be added to this name. The default is the name of the document being converted.

Path Name for .prc

This is the where the file that will be created by the conversion will be placed. The button next to this field can be used to browse a path. A default path will be entered initially, this default can be changed by clicking on the picture (see Setup below)

User Names

A list of user names is shown here for use with the automatic Hotsync. The most recently used username will default.

Doc Categories

The different categories are shown in a drop down box. By choosing one, the doc file created will show up in that category when HotSynced. Unfiled is the default.

Only some doc reader have categories. The doc reader I know about that use categories are searched for in the order of AportisDoc, TealDoc, SmartDoc and LinkDoc, and the categories are shown for the first reader found. That is, if you have AportisDoc and SmartDoc loaded as readers, only the categories for AportisDoc will be shown. If AportisDoc is deleted, then the SmartDoc categories will be shown. ToGo categories are shown only if the ToGo box is checked. (more info on the ToGo box below)

HotSync

If this box is checked, then the file will automatically be sent to be installed on the Palm unit next HotSync.

Setup (the Picture)

Clicking on the picture will display the setup part of the box (the lower part) where the default directory can be set. By placing the mouse over the picture, the tooltip shows the current default directory. The current default is C:\Doc.

Default Directory

The Default Directory field is displayed by clicking on the picture (see above). This default directory path is used by the "Path Name for .prc" above and for the Doc to Text default directory. This field has some pre-assigned directories with can be selected, a browse button to locate a directory, or a directory can be manually entered.

The pre-assigned directories are:

The next two field are only shown if the converters for the products are present

ToGo

Checking this box will convert the Word document into the ToGo format. Also the categories shown will be the ToGo categories.

This check box will only appear if the ToGo converter "ToGoDOS.exe" is in the same directory as the template (e.g. C:\Docs). This converter can be found at http://www.geocities.com/SiliconValley/Platform/9082/togodos.htm.

Warning: Presently there is no converter to change ToGo files back to text. Please keep a copy of the original file if required. Also this is a new product so the converter may change from the one presently supported.

RichReader

Checking this box will convert the Word document into the RichReader format before converting it to the doc format. The file will then only be suitable to be seen on the RichReader doc reader. Viewed on any other doc reader will show control characters throughout the file.

This check box will only appear if the RichReader converter "RTF2Doc.exe " is in a subdirectory from the template directory (e.g. C:\DOCS\RichReader\). I couldn't work otherwise. This converter can be found at http://www.erols.com/arenakm/palm/RichReader.html. Converter from version 1.4 is supported, earlier version won't work.

Warning: Presently there is no converter to change RichReader files back to text. Please keep a copy of the original file if required. Also this is a new product so the converter may change from the one presently supported.

 

Palm File Desc

When the Palm File Desc (L) button is pressed you are presented with the following box.

Path Name for .prc/.pdb

This is the directory for the file to be checked. The button next to this field can be used to browse a path. The default path used by the Doc conversion button can be selected by clicking on the picture.

Main Window

This shows the file name, the file type, either from a descriptive list, or the eight character name from the file, and the description from the file. The button at the top of each column can be used to sort these files in ascending order. When clicking on a file, the Install button will activate, and any number of files can be installed. Use Shift or Ctrl to select multiple file. When only one file selected, the Open button will activate. If the file is a Doc, Jfile or MobileDB file, the button will change to Convert, and the file will be converted and opened. Otherwise the file will just open (not too useful unless you are trying to work out the file format).

Merging Docs

If more then one Doc is select, the Open/Convert/Merge button will default to Merge in the order shown on the list. The Doc files will append one after another into one unsaved Word document.

Print

This will printout the list of files to the current cursor position in the active Word document.

User Names

A list of user names is shown here for use with the Install button. The most recently used username will default.

 

TROUBLE SHOOTING

The buttons don't appear
The .dot file is recommended that it be placed in the C:\Program Files\Microsoft Office\Office\Startup. This assumes that that is the Startup directory. This may be different for some people, or may have changed. To find out where the startup directory is, go to the menu options: Tools/Options and the File Locations tab. The file type is "Startup" and to see the whole "Location:" string press Modify... Whatever directory is shown there, put the .dot file into that directory. This should load the macro every time Word is open, making a toolbar appear.

LEGAL STUFF

This macro is provided as freeware and may be distributed freely. This is Beta software, but is stable (or as stable as Word is : ) ) but may not produce the expected results. That is, it works for me. This product is provided without warranty and the user accepts full responsibility for any damages, consequential or otherwise, resulting from its use.

GENERAL STUFF

This was put together for my own use from an initial idea from Dave Mac, bits of code from other macros I’ve written, and from a rather nice bit Delphi code developed by Art Dahm, that I had made into a dll. I’ve since cleaned up the code a bit (made it smaller and added comments etc). I’ve tried to put all the interesting stuff that the dll does (get user names, Pilot directory, install files to hotsync, etc) in one macro area and referenced to it. This is so you can use the code for other things that may take your fancy. If you find this useful or have got any comments to make I'd appreciate a quick email at gourleyh@enersis.co.nz. Cheers.