Formatting Utilities - HL7



Formatting Macros

(Style Fixer)

Last Update: 21st June 2000

This document contains macros which help formatting the HL7 standard documents. These pages provide an easy access to the macros.

In order to make use of the macros you have to enable them during loading this file.

The macros operate on open files. Therefor the corresponding document(s) should be opened first.

General Remarks

It is not such easy to do some auto-format an already formatted documents. We can try to format tables if an indication is available. We also can try to adjust the properties of styles according to the rules established by the publishing group. But I can not guarantee that this will work in any case since Word has a built-in automatism which tries to correct the actions we execute.

Additionally some documents make intensive use of direct formatting, especially when creating numeric, alpha-numeric or bulleted lists without using the style “Normal List xxxx”.

Another fact to mention is that these macros apply a huge amount of corrections. As a result an error may occur saying that Word is not able to keep track of all changes. A possible solution is to save the file to disc.

Formatting tables assumes that the tables are “real” tables with the same number of columns each row (except conformance statements). Furthermore all cells within the same column should have the same width. If this requirement is NOT acceptable please let me know. I can change that but it would increase computation time!

So, PLEASE execute these macros on safe copy of the document!

Adjust the properties of the styles

This macro was generated by the help of “Get All Formats”. In contrast to it this one adjusts the properties according to the style guide.

Double click here. Whenever such a button-like frame appears, it hides the macros which can be activated by double-clicking onto the text inside!

Currently the styles for lists do not adjust the numbering or bulleting due to problems with the rest of the styles! A lot of paragraphs are formatted directly so that such an approach surprisingly displays funny results.

Format all Tables within the document

This macro formats all relevant tables. First of all the user is asked for the document to which the formatting should be applied. For this purpose a combo box will be displayed. After selecting the file out of the list the formatting rules will be applied to all tables within this document. Up to now I haven’t found a method to align the whole cell like it can be done by “Table->Mark whole table” and “center”, so this is left for manual correction. The correct rules are determined out of the formatting of the upper left cell of each table:

This task will take up to 5 to 10 minutes to apply the rules to all tables!

References

The next macro provides a dialog which allows for modifying the reference entries. It starts with a combo box for selecting the document. Next a dialog will be shown which guides through the formatting process:

If the necessary character styles are not available they will be created automatically.

The button “next” searches for the next text which corresponds to the format specified in the top frame (italics or bolded) and is not formatted as a reference (at least the left part of it). According to the text found the action to be performed will be selected automatically. The user has the opportunity to modify this selection by hand. On the one hand he can modify the action to be performed. On the other hand he can expand or shrink the selected text be the help of the four buttons at the top right corner of this dialog.

The button “apply” performs the specified modification of the styles on the selected text.

At this place it is important to mention that the styles are assigned to the exact selected text. Otherwise the usage of styles becomes worthless.

Adjust the numbering of the headings

The numbering of the different chapters requires a manual adaptation of the corresponding properties. This macro asks for the chapter number.

This macro currently does not adjust the tab stops. Therefor this macro should be applied before the following one.

Delete unused styles

This macro deletes all styles which are not used an more.

This task will take up to 3 hours to check each paragraph separately! It would be quicker just to delete the styles, but we want to keep the layout information we have entered so far. This is the only solution if the old and the new style are used in parallel.

Get All Formats

This macro should be used to generate a VBA procedure which can be used to adjust the styles of other documents. This macro appends VBA-code which can be copied to a new module to the end of the document. This code allows for copying the properties listed in the style guide.

This code does not adjust the properties, it just copies the values to the document in a readable form. Therefor it is not necessary to execute it!

Requirements to run the macros

Running of the macros above requires VBA.

Manually Correcting Styles

The styles can be corrected by hand, too. Using “Format => Styles” displays a list of all used styles. Here you can modify the name of the styles by just typing in the correct name. Wherever the styles is used the new name is assigned.

Questions/Errors

Please let me know if there are questions or errors in applying these macros:

Frank.Oemig@

It would be helpful to submit the name of the macro and the name of the function and the line number – is possible.

History (last changes)

• formatting column width for attribute and message tables

• setting styles for conformance statements

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download