![]() WordPerfect's default happened to be 2.5 cm while OpenOffice's default was 2 cm. This macro gets paragraph margin sizes from the first paragraph on the page and makes paragraph margins equal zero while enlarging page margins to compensate for that.Īn extra quirk is that wpd2sxw assumed that default page margins in WordPerfect and would be the same - which was not quite right. Of course, I wanted to have the more natural 4 cm page margins and no additional paragraph margins. Even though all paragraphs had exactly the same left margin sizes (4 cm), in converted documents page margins stayed at the default 2 cm while the other 2 cm were paragraph margins. Wpd2sxw chose to use both margin types for converted documents. 2 cm page margin + 2 cm paragraph margin or any other combination which sums up to 4 cm). Thus, for example, the effect of having a paragraph start 4 centimeters from the left page edge can be represented in exactly one way in WordPerfect (margin = 4 cm for that paragraph), but in many ways in (e.g. In contrast, WordPerfect assigns margin sizes to paragraphs - there are no separate entities for page and paragraph margins. In OpenOffice, margin sizes are a page property - paragraph indentation has to be used in order to have paragraphs with different spacing from the left page edge. WordPerfect handles margins in a slightly different way than does. Here, setting a page's property is accomplished by finding the corresponding style object and modifying that style's properties. ![]() Simple as it is, this example demonstrates the extensive use of styles in. OStyle = ("PageStyles").getByName("Default") ODoc = IIf(IsMissing(doc), ThisComponent, doc) This macro sets a document's default page size to A4 (210x297 mm): Converted documents all defaulted to Letter, while A4 was used in the original files. ![]() When I converted my WordPerfect documents, wpd2sxw failed to save the page size in the newly created files. Generally, they were designed for 1.1, but most also work in 1.0 and should work with different versions of StarOffice as well. For brevity, the macros listed in this article usually don't declare variables they use, so they won't work with Option Explicit. You can edit and run macros in through the Macro dialog box (Tools->Macros->Macro.), which is more or less self-explanatory. You can find tutorials and general information regarding StarBasic macros, along with information on scripting, elsewhere on the Web. I won't go into details of the language itself, but the examples given here should be easy to understand if you have some programming experience. This article presents some macro "building blocks" you can use to modify a document's formatting or to generate well-formatted documents from plain text files. After conversion with wpd2sxw, which was rather good but had problems with some formatting features, I applied macros to documents based on different templates to make more than 2,000 converted documents look very similar to original WordPerfect files they were generated from. by itself does not support reading or writing WordPerfect files, but a tool called wpd2sxw can convert WordPerfect files to format (SXW). Resulting from loss of use, data or profits, whether in an action ofĬontract, negligence or other tortious action, arising out of or inĬonnection with the use of this document.įormatting documents with Writer macrosĪround the time 1.1 RC was released, I was migrating a small company from Corel WordPerfect to. Special, indirect or consequential damages or any damages whatsoever Including all implied warranties of merchantability and fitness for aĬertain purpose in no event shall the author be liable for any The author disclaims all warranties with regard to this document, ![]() Code samples in this article are hereby put in the public domain. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |