home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 1998-07-08 | 129.8 KB | 2,893 lines
REM Generates style sheet information [CorelSCRIPT 8] REM StyleSheetInformation.csc March, 1998 REM ⌐ 1998 Corel Corporation. All rights reserved. REM ********************************************************************** REM This script extracts paragraph tag information for the specified ventura publication. REM ParaTag info can be written to any of the following formats: REM Corel VENTURA 7 REM Corel Quattro Pro REM Corel SCRIPT REM MS Excel REM ASCII Text file REM ********************************************************************** #addfol "..\..\Scripts" ' create a tmporary folder to provide a path for the include files #include "ScpConst.csi" ' this enables the include files to be located #include "VPConst.csi" ' Constants for ANSII Char Set #define QUOTE CHR(34) ' Constants for Dialog Return Values GLOBAL CONST DIALOG_RETURN_CANCEL% = 2 GLOBAL CONST DIALOG_RETURN_NEXT% = 3 GLOBAL CONST DIALOG_RETURN_BACK% = 4 GLOBAL CONST DIALOG_RETURN_BROWSE% = 5 ' Constants for Selected Application GLOBAL CONST PUBLISH_TO_VENTURA% = 0 GLOBAL CONST PUBLISH_TO_QUATTROPRO% = 1 GLOBAL CONST PUBLISH_TO_SCRIPT% = 2 GLOBAL CONST PUBLISH_TO_EXCEL% = 3 GLOBAL CONST PUBLISH_TO_TEXT% = 4 ' Embed bitmaps if script is to be compiled into exe or csb formats ' this will eliminate the need to include these files #ADDRESBMP IntroBMP "Bitmaps\IntroBMP.bmp" #ADDRESBMP Step2BMP "Bitmaps\Step2BMP.bmp" #ADDRESBMP Step3BMP "Bitmaps\Step3BMP.bmp" #ADDRESBMP LastBMP "Bitmaps\LastBMP.bmp" ' Definitions for Ventura units #DEFINE INCHES 1 #DEFINE MILLIMETERS 2 #DEFINE PICAS 3 #DEFINE POINTS 4 #DEFINE CICEROS 5 #DEFINE DIDOTS 6 '/////FUNCTION & SUBROUTINE DECLARATIONS///////////////////////////////////////////////// ' Windows API functions DECLARE FUNCTION FindWindow LIB "user32" (BYVAL lpClassName AS STRING, BYVAL lpWindowName AS LONG) AS LONG ALIAS "FindWindowA" DECLARE FUNCTION ShellExecute Lib "shell32.dll" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long Alias "ShellExecuteA" ' Dialog functions and subroutines DECLARE FUNCTION ShowIntro%() DECLARE FUNCTION GetVentFile%() DECLARE FUNCTION SelectApp%() DECLARE FUNCTION GetDestinationFile%() DECLARE FUNCTION GetUnitInfo% DECLARE FUNCTION ShowFinish%() DECLARE SUB ShowSummary() ' Local functions and subroutines DECLARE FUNCTION RegQuery(MainKey&, SubKey$, Value$) AS STRING DECLARE SUB UseVentura() DECLARE SUB UseScript() DECLARE SUB UseQP() DECLARE SUB UseExcel() DECLARE SUB UseTextFile(TextFile$) DECLARE SUB GetLine(Variable$) DECLARE SUB CreateAutoCloseFile() DECLARE FUNCTION DoesFileExist(FileName$) AS BOOLEAN DECLARE SUB UpDateQPMacro() DECLARE SUB ConvertTo(Units&, BYREF ConvertData AS DOUBLE) DECLARE SUB Round(Value#, Precision#) DECLARE SUB Initialize ' paragraph attribute functions and subroutines DECLARE SUB GetMasterPageGeneral(MasterPageName$) DECLARE SUB GetMasterPageMargins(MasterPageName$, PageType AS BOOLEAN) DECLARE SUB GetMasterPageColumns(MasterPageName$, PageType AS BOOLEAN) DECLARE SUB GetParaFontInfo DECLARE SUB GetParaColorInfo(Background AS BOOLEAN) DECLARE SUB GetParaEffects DECLARE SUB GetBulletInfo DECLARE SUB GetDropCapsInfo DECLARE SUB GetEffectFontInfo DECLARE SUB GetEffectColorInfo(EffectBackGround AS BOOLEAN) DECLARE SUB GetParaAlignmentInfo DECLARE SUB GetParaSpacingInfo DECLARE SUB GetParaTabInfo DECLARE SUB GetParaBreaksInfo DECLARE SUB GetParaHyphenationInfo DECLARE SUB GetParaTypographyInfo DECLARE SUB GetParaDefaultsInfo '/////GLOBAL VARIABLES //////////////////////////////////////////////////////// GLOBAL VenturaDir$ ' Root directory where Ventura is installed GLOBAL CloseVal& ' Variable indicating whether to leave pub open or closed: 0-leave open; 1-close GLOBAL InputFile$ ' The name of the Ventura publication from which to extract style information GLOBAL OutputFile$ ' The name of the file in which to output information (file type varies depending on application selected) GLOBAL SelectedApp& ' Specifies the application to publish the style information to : 0-Ventura; 1-QuattroPro; 2- Script; 3-Excel; 4-Text file GLOBAL FileFilter$ ' The file extension of the selected application (used by GETFILEBOX() file extension parameter) GLOBAL OpenPubs% ' The number of open Ventura publication GLOBAL StylesFile$ 'REM look into whether we actually need this CloseVal& = 0 GLOBAL QPFile$ ' The name of the Quattro Pro file GLOBAL ExcelPath$ ' The path to the Excel executable (Excel.exe) GLOBAL DialogTitle$ ' The title of the dialog - the name of the active Ventura publication is displayed ' Defines and dimensions the array listing the available unit types GLOBAL Units$(6) Units$(1) = "inches" Units$(2) = "millimeters" Units$(3) = "picas, points" Units$(4) = "points" Units$(5) = "ciceros, didots" Units$(6) = "didots" ' Defines and initializes the units of measurement to be used for the various settings GLOBAL FontUnits& : FontUnits& = 4 'default font units to points GLOBAL DimensionUnits& : DimensionUnits& = 1 'default dimension units to inches GLOBAL MarginUnits& : MarginUnits& = 1 'default margin units to inches GLOBAL LineUnits& : LineUnits& = 4 'default line units to points GLOBAL UnderlineUnits& : UnderlineUnits& = 4 'default underline units to points GLOBAL HorizontalUnits& : HorizontalUnits& = 1 'default horizontal units to inches GLOBAL VerticalUnits& : VerticalUnits& = 4 'default vertical units to points ' Declares variables used for formatting the text file depending on which format the output will be written to GLOBAL NEWLINE$ ' Specifies the formatting to be used for a new line GLOBAL TITLE_PREFIX$ ' Specifies the formatting to be used for the title GLOBAL SECTION_PREFIX$ ' Specifies the formatting to be used for the section heading GLOBAL DIALOG_PREFIX$ ' Specifies the formatting to be used for the dialog heading GLOBAL TAG_PREFIX$ ' Specifies the formatting to be used for each tag name GLOBAL UNITS_PREFIX$ ' Specifies the formatting to be used for the units GLOBAL PREFIX_CHAR$ ' Specifies the formatting to be used for inserting text at the start of a line GLOBAL SPACE_CHAR$ ' Specifies the formatting to be used for inserting a space ' ************************************************************************************** ' MAIN ' ************************************************************************************** '///// LOCAL DECLARATIONS //////////////////////////////////////////////////////////////////////////////////// CONST MAXSTEP% = 6 ' Maximum number of steps in dialog loop (ie. Indicates when to exit dialog loop) DIM DialogReturn% ' Variable indicating which button was pressed on the most recent dialog DIM NextStep% ' Variable indicating which dialog to activate next DialogReturn% = 1 ' Initialize dialog counter to start at the first dialog ON ERROR GOTO ErrorHandler 'get root directory where Ventura is installed VenturaMainKey& = HKEY_LOCAL_MACHINE VenturaSubKey$ = VENTURA_REGQUERY_CONST VenturaValue$ = "Destination" VenturaDir$ = RegQuery(VenturaMainKey&, VenturaSubKey$, VenturaValue$) InputFile$=VenturaDir$ & "\Ventura\Samples" OutputFile$=VenturaDir$ & "\Ventura\Samples" ' Dialog loop DO SELECT CASE NextStep% CASE 1: DialogReturn% = ShowIntro() ' Show Intro dialog CASE 2: DialogReturn% = GetVentFile() ' Get input pub CASE 3: DialogReturn% = SelectApp() ' Get output application CASE 4: DialogReturn% = GetUnitInfo() ' Get units to display attributes CASE 5: DialogReturn% = GetDestinationFile() ' Get output file name CASE 6: DialogReturn% = ShowFinish() ' Show finish dialog END SELECT NextStep% = NextStep% + DialogReturn% LOOP UNTIL NextStep% = MAXSTEP + 1 Initialize ExitScript: STOP ErrorHandler: SELECT CASE ErrNum CASE 800 MESSAGE "FATAL ERROR" & CHR(13) & "Script will now exit." RESUME AT ExitScript CASE ELSE MESSAGE "ERROR: " & STR(ErrNum) & CHR(13) & "Script will now exit." RESUME AT ExitScript END SELECT ' ************************************************************************************** ' RegQuery ' This subroutine queries the Registry to determine the root directory where Ventura is installed ' ************************************************************************************** FUNCTION RegQuery(MainKey&, SubKey$, Value$) AS STRING ON ERROR RESUME NEXT RegQuery = REGISTRYQUERY(MainKey&, SubKey$, Value$) END FUNCTION ' ************************************************************************************** ' GetLine ' This subroutine reads a line of text from the open text file. ' ' PARAMS: Variable - the string variable holding the line of text read. ' ' ************************************************************************************** SUB GetLine(Variable$) DO LINE INPUT #1, Variable$ LOOP UNTIL LEN(Variable$)>1 OR EOF(1) END SUB ' ************************************************************************************** ' DoesFileExist ' This function determines whether the specified file exists. ' ' PARAMS:FileName AS STRING - The name and path of the file in question. ' RETURNS: DoesFileExist AS BOOLEAN - TRUE if the file exists. ' - FALSE if the file does not exist. ' ************************************************************************************** FUNCTION DoesFileExist(FileName$) AS BOOLEAN ON ERROR GOTO ErrorHandler FileStatus$ = FINDFIRSTFOLDER(FileName$, FILEATTR_READ_ONLY OR FILEATTR_HIDDEN OR FILEATTR_SYSTEM OR FILEATTR_ARCHIVE OR FILEATTR_NORMAL_FILE OR FILEATTR_TEMPORARY) IF FileStatus$ = "" THEN DoesFileExist = FALSE ELSE DoesFileExist = TRUE ENDIF FunctionEnd: EXIT FUNCTION ErrorHandler: SELECT CASE ErrNum CASE ELSE DoesFileExist = FALSE END SELECT RESUME AT FunctionEnd END FUNCTION ' ************************************************************************************** ' Initialize ' This subroutine initializes Ventura and calls the appropriate subroutine based on user ' output selection. ' ' PARAMS: None ' ************************************************************************************** SUB Initialize WITHOBJECT OBJECT_VENTURA8 .SetVisible TRUE IF OpenPubs% = 0 THEN .FileOpen InputFile$ ELSE CurrentPub$ = .PublicationName() IF CurrentPub$ <> InputFile$ THEN .FileOpen InputFile$ ENDIF ENDIF END WITHOBJECT SELECT CASE SelectedApp& CASE PUBLISH_TO_VENTURA UseVentura CASE PUBLISH_TO_QUATTROPRO UseQP CASE PUBLISH_TO_SCRIPT UseScript CASE PUBLISH_TO_EXCEL UseExcel CASE PUBLISH_TO_TEXT TITLE_PREFIX$ = "@Title = " SECTION_PREFIX$ = "@Section = Paragraph Tag Settings" DIALOG_PREFIX$ = "@Dialog = " TAG_PREFIX$ = "@Tag Name = " PREFIX_CHAR$ = CHR(9) NEWLINE$ = CHR(13) & CHR(10) SPACE_CHAR$ = CHR(9) UNITS_PREFIX$ = " " UseTextFile(OutputFile$) MESSAGE OutputFile$ & CHR(13) & "has been created." END SELECT END SUB ' ************************************************************************************** ' ShowIntro ' This function displays the introduction dialog. ' ' PARAMS:None ' ' RETURNS: ShowIntro AS INTEGER - Integer indicating dialog return value(user selection) ' ************************************************************************************** FUNCTION ShowIntro% DIM IntroRet% BEGIN DIALOG OBJECT IntroDialog 290, 180, "Stylesheet Information Wizard", SUB IntroDialogEventHandler PUSHBUTTON 181, 160, 46, 14, .NextButton, "&Next >" CANCELBUTTON 234, 160, 46, 14, .CancelButton PUSHBUTTON 135, 160, 46, 14, .BackButton, "< &Back" TEXT 95, 10, 185, 20, .Text2, "This Wizard generates stylesheet information, including paragraph and page tag information." TEXT 95, 60, 185, 18, .Text3, "To begin, click Next." IMAGE 10, 10, 75, 130, .IntroImage GROUPBOX 10, 150, 270, 5, .LineGroupBox TEXT 124, 126, 102, 12, .Text5, "Overrides will not be included." TEXT 97, 126, 25, 9, .Text4, "Note:" TEXT 95, 30, 185, 29, .Text6, "Paragraph tag information written out to a spreadsheet can be edited and then used to create a new stylesheet based on your changes." END DIALOG IntroDialog.IntroImage.SetImage "#IntroBMP" IntroDialog.IntroImage.SetStyle STYLE_CENTERED IntroRet%=DIALOG(IntroDialog) IF IntroRet% = DIALOG_RETURN_CANCEL THEN STOP IF IntroRet% = DIALOG_RETURN_NEXT THEN WITHOBJECT OBJECT_VENTURA8 'see if there is an open pub OpenPubs% = .CountWindows() IF OpenPubs% <> 0 THEN IF DoesFileExist(InputFile$)=TRUE THEN first% = 1 pos% = 1 DO WHILE first <> 0 first% = INSTR(InputFile$, "\", first%) IF first% <> 0 THEN pos% = first% first% = first% + 1 END IF LOOP DialogTitle$ = MID(InputFile$, pos%+1) DialogTitle$ = "Stylesheet Information Wizard - " & DialogTitle$ ShowIntro = 2 ELSE InputFile$ = .PublicationName() DialogTitle$ = "Stylesheet Information Wizard" ShowIntro = 1 ENDIF ELSE DialogTitle$ = "Stylesheet Information Wizard" ShowIntro = 1 ENDIF END WITHOBJECT ENDIF END FUNCTION ' ************************************************************************************** ' IntroDialogEventHandler ' This subroutine handles events for the intro dialog. ' PARAMS: BYVAL ControlID% - Integer indicating the dialog control that is generating a dialog event. ' BYVAL Event% - Integer indicating the dialog event that has occurred in the dialog box ' ************************************************************************************** SUB IntroDialogEventHandler(BYVAL ControlID%, BYVAL Event%) IF Event% = EVENT_INITIALIZATION THEN IntroDialog.BackButton.Enable FALSE ENDIF IF Event% = EVENT_MOUSE_CLICK THEN SELECT CASE ControlID% CASE IntroDialog.NextButton.GetID() IntroDialog.CloseDialog DIALOG_RETURN_NEXT CASE IntroDialog.CancelButton.GetID() IntroDialog.CloseDialog DIALOG_RETURN_CANCEL END SELECT ENDIF END FUNCTION ' ************************************************************************************** ' GetVentFile ' This function prompts the user for the name of the Ventura pub from which to obtain ' para tag information. ' Also prompts user whether to close pub when finished. ' ' PARAMS: ' ' RETURNS: GetVentFile AS INTEGER - Integer indicating dialog return value(user selection) ' ' ************************************************************************************** FUNCTION GetVentFile% BEGIN DIALOG OBJECT GetVentFileDialog 290, 180, DialogTitle$, SUB GetVentFileDialogEventHandler TEXTBOX 100, 36, 175, 13, .VentFileTextBox PUSHBUTTON 227, 57, 46, 14, .BrowseButton, "B&rowse..." CHECKBOX 100, 87, 140, 12, .CloseValCheckBox, "&Close publication when finished" PUSHBUTTON 135, 160, 46, 14, .BackButton, "< &Back" PUSHBUTTON 181, 160, 46, 14, .NextButton, "&Next >" CANCELBUTTON 234, 160, 46, 14, .CancelButton GROUPBOX 94, 28, 185, 55, .GroupBox1 IMAGE 10, 10, 75, 130, .VentFileImage GROUPBOX 10, 150, 270, 5, .LineGroupBox TEXT 95, 10, 185, 20, .Text2, "From which Corel VENTURA Publication would you like to extract paragraph tag information?" TEXT 95, 130, 185, 12, .Text3, "Testing" END DIALOG GetVentFileDialog.VentFileImage.SetImage "#Step2BMP" GetVentFileDialog.VentFileImage.SetStyle STYLE_CENTERED GetVentFileDialog.VentFileTextBox.SetText InputFile$ GetVentFileDialog.CloseValCheckBox.SetValue CloseVal& GetVentFileDialog.CloseValCheckBox.SetThreeState FALSE GetVentFileDialog.Text3.SetStyle STYLE_SUNKEN GetVentFileDialog.SetStyle STYLE_INVISIBLE GetVentFileRet%=DIALOG(GetVentFileDialog) SELECT CASE GetVentFileRet% CASE DIALOG_RETURN_CANCEL STOP CASE DIALOG_RETURN_NEXT GetVentFile = 1 CASE DIALOG_RETURN_BACK GetVentFile = -1 END SELECT END FUNCTION ' ************************************************************************************** ' GetVentFileDialogEventHandler ' This subroutine handles events for the Ventura file dialog. ' PARAMS: BYVAL ControlID% - Integer indicating the dialog control that is generating a dialog event. ' BYVAL Event% - Integer indicating the dialog event that has occurred in the dialog box ' ************************************************************************************** SUB GetVentFileDialogEventHandler(BYVAL ControlID%, BYVAL Event%) IF Event% = EVENT_INITIALIZATION THEN GetVentFileDialog.SetStyle STYLE_VISIBLE InputFile$ = GetVentFileDialog.VentFileTextBox.GetText() IF DoesFileExist(InputFile$)=TRUE THEN GetVentFileDialog.NextButton.Enable TRUE GetVentFileDialog.Text3.SetText "" GetVentFileDialog.Text3.SetStyle STYLE_INVISIBLE ELSE GetVentFileDialog.NextButton.Enable FALSE GetVentFileDialog.Text3.SetText "You need to save your file or specify a file that exists." GetVentFileDialog.Text3.SetStyle STYLE_VISIBLE ENDIF ENDIF IF Event% = EVENT_CHANGE_IN_CONTENT THEN SELECT CASE ControlID% CASE GetVentFileDialog.VentFileTextBox.GetID() InputFile$ = GetVentFileDialog.VentFileTextBox.GetText() END SELECT ENDIF IF Event% = EVENT_MOUSE_CLICK THEN SELECT CASE ControlID% CASE GetVentFileDialog.NextButton.GetID() GetVentFileDialog.closedialog DIALOG_RETURN_NEXT CASE GetVentFileDialog.BackButton.GetID() GetVentFileDialog.closedialog DIALOG_RETURN_BACK CASE GetVentFileDialog.CancelButton.GetID() GetVentFileDialog.closedialog DIALOG_RETURN_CANCEL CASE GetVentFileDialog.BrowseButton.GetID() InFile$ = GETFILEBOX("*.vp*|*.vp*", , , , "*.vp*", VenturaDir$ & "\Ventura\Samples") IF InFile$ <> "" THEN InputFile$ = InFile$ GetVentFileDialog.VentFileTextBox.SetText InputFile$ first% = 1 pos% = 1 DO WHILE first <> 0 first% = INSTR(InputFile$, "\", first%) IF first% <> 0 THEN pos% = first% first% = first% + 1 END IF LOOP DialogTitle$ = MID(InputFile$, pos%+1) DialogTitle$ = "Style Information Wizard - " & DialogTitle$ GetVentFileDialog.SetText DialogTitle$ CASE GetVentFileDialog.CloseValCheckBox.GetID() CloseVal& = GetVentFileDialog.CloseValCheckBox.GetValue() END SELECT ENDIF InputFile$ = GetVentFileDialog.VentFileTextBox.GetText() IF DoesFileExist(InputFile$)=TRUE THEN GetVentFileDialog.NextButton.Enable TRUE GetVentFileDialog.Text3.SetText "" GetVentFileDialog.Text3.SetStyle STYLE_INVISIBLE ELSE GetVentFileDialog.NextButton.Enable FALSE GetVentFileDialog.Text3.SetText "You need to save your file or specify a file that exists." GetVentFileDialog.Text3.SetStyle STYLE_VISIBLE ENDIF END SUB ' ************************************************************************************** ' SelectApp ' This function prompts the user to choose Ventura or Excel. ' ' PARAMS: ' ' RETURNS: SelectApp AS INTEGER - Integer indicating dialog return value(user selection) ' ************************************************************************************** FUNCTION SelectApp% BEGIN DIALOG OBJECT SelectAppDialog 290, 180, DialogTitle$, SUB SelectAppDialogEventHandler OPTIONGROUP .SelectedAppOption OPTIONBUTTON 130, 35, 130, 12, .VenturaOption, "Corel &VENTURA" OPTIONBUTTON 130, 50, 130, 12, .QuattroProOption, "Corel &Quattro Pro" OPTIONBUTTON 130, 65, 130, 12, .ScriptOption, "Corel &SCRIPT" OPTIONBUTTON 130, 80, 130, 12, .ExcelOption, "E&xcel" OPTIONBUTTON 130, 95, 130, 12, .TextOption, "&Text File" PUSHBUTTON 135, 160, 46, 14, .BackButton, "< &Back" PUSHBUTTON 181, 160, 46, 14, .NextButton, "&Next >" CANCELBUTTON 234, 160, 46, 14, .CancelButton TEXT 95, 10, 185, 20, .Text1, "To which format would you like the paragraph tag information extracted?" GROUPBOX 95, 25, 185, 90, .GroupBox1, "" IMAGE 10, 10, 75, 130, .SelectAppImage GROUPBOX 10, 150, 270, 5, .LineGroupBox TEXT 95, 120, 185, 20, .StatusText, "" END DIALOG SelectAppDialog.SelectAppImage.SetImage "#Step2BMP" SelectAppDialog.SelectAppImage.SetStyle STYLE_CENTERED SelectAppDialog.StatusText.SetStyle STYLE_SUNKEN SelectAppDialog.SetStyle STYLE_INVISIBLE SelectAppRet%=DIALOG(SelectAppDialog) IF SelectAppRet% = DIALOG_RETURN_CANCEL THEN STOP IF SelectAppRet% = DIALOG_RETURN_NEXT THEN SelectedApp& = SelectAppDialog.SelectedAppOption.GetValue() OutputFile$ = "" IF SelectedApp& = PUBLISH_TO_SCRIPT THEN SelectApp=2 ELSE SelectApp=1 ENDIF ENDIF IF SelectAppRet% = DIALOG_RETURN_BACK THEN IF OpenPubs% = 0 THEN SelectApp = -1 ELSE SelectApp = -2 ENDIF ENDIF END FUNCTION ' ************************************************************************************** ' SelectAppDialogEventHandler ' This subroutine handles events for the selec application dialog. ' PARAMS: BYVAL ControlID% - Integer indicating the dialog control that is generating a dialog event. ' BYVAL Event% - Integer indicating the dialog event that has occurred in the dialog box ' ************************************************************************************** SUB SelectAppDialogEventHandler(BYVAL ControlID%, BYVAL Event%) ON ERROR RESUME NEXT IF Event% = EVENT_INITIALIZATION THEN SelectAppDialog.SetStyle STYLE_VISIBLE SelectedApp& = SelectAppDialog.SelectedAppOption.GetValue() SELECT CASE SelectedApp& CASE PUBLISH_TO_VENTURA SelectAppDialog.StatusText.SetText "Publishes page and paragraph tag information to a Corel VENTURA publication." CASE PUBLISH_TO_QUATTROPRO SelectAppDialog.StatusText.SetText "Publishes paragraph tag information to a QuattroPro spreadsheet." CASE PUBLISH_TO_SCRIPT SelectAppDialog.StatusText.SetText "Creates a script that applies paragraph tags to a new publication." CASE PUBLISH_TO_EXCEL SelectAppDialog.StatusText.SetText "Publishes paragraph tag information to an Excel spreadsheet." CASE PUBLISH_TO_TEXT SelectAppDialog.StatusText.SetText "Publishes page and paragraph tag information to a text file." END SELECT ENDIF IF Event% = EVENT_MOUSE_CLICK THEN SELECT CASE ControlID% CASE SelectAppDialog.NextButton.GetID() SelectedApp& = SelectAppDialog.SelectedAppOption.GetValue() SELECT CASE SelectedApp& CASE PUBLISH_TO_QUATTROPRO QPMainKey& = HKEY_CLASSES_ROOT QPSubKey$ = "QuattroPro.PerfectScript" WPSubKey$ = "WordPerfect.PerfectScript" QPValue$ = "" IF RegQuery(QPMainKey&, QPSubKey$, QPValue$) = "" OR RegQuery(QPMainKey&, WPSubKey$, QPValue$) = ""THEN MESSAGE "Unable to locate QuattroPro registry information." ELSE SelectAppDialog.closedialog DIALOG_RETURN_NEXT ENDIF CASE PUBLISH_TO_EXCEL ExcelMainKey& = HKEY_LOCAL_MACHINE ExcelSubKey$ = "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\EXCEL.EXE" ExcelValue$ = "" IF RegQuery(ExcelMainKey&, ExcelSubKey$, ExcelValue$) = "" THEN MESSAGE "Unable to locate Excel.exe" ELSE SelectAppDialog.closedialog DIALOG_RETURN_NEXT ENDIF CASE ELSE SelectAppDialog.closedialog DIALOG_RETURN_NEXT END SELECT CASE SelectAppDialog.BackButton.GetID() SelectAppDialog.closedialog DIALOG_RETURN_BACK CASE SelectAppDialog.CancelButton.GetID() SelectAppDialog.closedialog DIALOG_RETURN_CANCEL CASE SelectAppDialog.VenturaOption.GetID() SelectAppDialog.StatusText.SetText "Publishes page and paragraph tag information to a Corel VENTURA publication." CASE SelectAppDialog.QuattroProOption.GetID() SelectAppDialog.StatusText.SetText "Publishes paragraph tag information to a QuattroPro spreadsheet." CASE SelectAppDialog.ScriptOption.GetID() SelectAppDialog.StatusText.SetText "Creates a script that applies paragraph tags to a new publication." CASE SelectAppDialog.ExcelOption.GetID() SelectAppDialog.StatusText.SetText "Publishes paragraph tag information to an Excel spreadsheet." CASE SelectAppDialog.TextOption.GetID() SelectAppDialog.StatusText.SetText "Publishes page and paragraph tag information to a text file." END SELECT ENDIF END SUB ' ************************************************************************************** ' GetUnitInfo ' This function prompts the user to select which units to display the settings. ' ' PARAMS: ' ' RETURNS: GetUnitInfo AS INTEGER - Integer indicating dialog return value(user selection) ' ************************************************************************************** FUNCTION GetUnitInfo% BEGIN DIALOG OBJECT GetUnitInfoDialog 290, 180, DialogTitle$, SUB GetUnitInfoDialogEventHandler TEXT 95, 32, 65, 12, .Text6, "&Font Size:" DDLISTBOX 165, 30, 95, 70, .FontSizeListBox TEXT 95, 48, 66, 12, .Text2, "&Dimensions:" DDLISTBOX 165, 46, 95, 70, .DimensionListBox TEXT 95, 64, 65, 10, .Text3, "&Columns && Margins:" DDLISTBOX 165, 62, 95, 70, .MarginsListBox TEXT 95, 80, 70, 10, .Text4, "&Lines:" DDLISTBOX 165, 78, 95, 70, .LinesListBox TEXT 96, 96, 65, 10, .Text5, "&Underlines:" DDLISTBOX 165, 94, 95, 70, .UnderlineListBox TEXT 96, 112, 65, 10, .Text7, "Hori&zontal Spacing:" DDLISTBOX 165, 110, 95, 70, .HorizontalListBox TEXT 96, 128, 65, 10, .Text8, "&Vertical Spacing:" DDLISTBOX 165, 126, 95, 70, .VerticalListBox PUSHBUTTON 135, 160, 46, 14, .BackButton, "< &Back" PUSHBUTTON 181, 160, 46, 14, .NextButton, "&Next >" CANCELBUTTON 234, 160, 46, 14, .CancelButton TEXT 95, 10, 185, 20, .Text1, "Select the unit of measurement you would like to use for the corresponding settings." IMAGE 10, 10, 75, 130, .DestinationFileImage GROUPBOX 10, 150, 270, 5, .LineGroupBox END DIALOG GetUnitInfoDialog.SetStyle STYLE_INVISIBLE GetUnitInfoDialog.DestinationFileImage.SetImage "#Step3BMP" GetUnitInfoDialog.DestinationFileImage.SetStyle STYLE_CENTERED GetUnitInfoDialog.FontSizeListBox.SetArray Units$ GetUnitInfoDialog.FontSizeListBox.SetSelect FontUnits& GetUnitInfoDialog.DimensionListBox.SetArray Units$ GetUnitInfoDialog.DimensionListBox.SetSelect DimensionUnits& GetUnitInfoDialog.MarginsListBox.SetArray Units$ GetUnitInfoDialog.MarginsListBox.SetSelect MarginUnits& GetUnitInfoDialog.UnderlineListBox.SetArray Units$ GetUnitInfoDialog.UnderlineListBox.SetSelect UnderlineUnits& GetUnitInfoDialog.HorizontalListBox.SetArray Units$ GetUnitInfoDialog.HorizontalListBox.SetSelect HorizontalUnits& GetUnitInfoDialog.VerticalListBox.SetArray Units$ GetUnitInfoDialog.VerticalListBox.SetSelect VerticalUnits& GetUnitInfoDialog.LinesListBox.SetArray Units$ GetUnitInfoDialog.LinesListBox.SetSelect LineUnits& GetUnitInfoRet%=DIALOG(GetUnitInfoDialog) SELECT CASE GetUnitInfoRet% CASE DIALOG_RETURN_CANCEL STOP CASE DIALOG_RETURN_NEXT GetUnitInfo = 1 CASE DIALOG_RETURN_BACK GetUnitInfo = -1 END SELECT END FUNCTION ' ************************************************************************************** ' UnitInfoDialogEventHandler ' This subroutine handles events for the destination file dialog. ' PARAMS: BYVAL ControlID% - Integer indicating the dialog control that is generating a dialog event. ' BYVAL Event% - Integer indicating the dialog event that has occurred in the dialog box ' ************************************************************************************** SUB GetUnitInfoDialogEventHandler(BYVAL ControlID%, BYVAL Event%) IF Event% = EVENT_INITIALIZATION THEN GetUnitInfoDialog.SetStyle STYLE_VISIBLE ENDIF IF Event% = EVENT_MOUSE_CLICK THEN SELECT CASE ControlID% CASE GetUnitInfoDialog.NextButton.GetID() GetUnitInfoDialog.closedialog DIALOG_RETURN_NEXT CASE GetUnitInfoDialog.BackButton.GetID() GetUnitInfoDialog.closedialog DIALOG_RETURN_BACK CASE GetUnitInfoDialog.CancelButton.GetID() GetUnitInfoDialog.closedialog DIALOG_RETURN_CANCEL CASE GetUnitInfoDialog.FontSizeListBox.GetID() FontUnits& = GetUnitInfoDialog.FontSizeListBox.GetSelect() CASE GetUnitInfoDialog.UnderlineListBox.GetID() UnderlineUnits& = GetUnitInfoDialog.UnderlineListBox.GetSelect() CASE GetUnitInfoDialog.HorizontalListBox.GetID() HorizontalUnits& = GetUnitInfoDialog.HorizontalListBox.GetSelect() CASE GetUnitInfoDialog.VerticalListBox.GetID() VerticalUnits& = GetUnitInfoDialog.VerticalListBox.GetSelect() CASE GetUnitInfoDialog.DimensionListBox.GetID() DimensionUnits& = GetUnitInfoDialog.DimensionListBox.GetSelect() CASE GetUnitInfoDialog.LinesListBox.GetID() LineUnits& = GetUnitInfoDialog.LinesListBox.GetSelect() END SELECT ENDIF END SUB ' ************************************************************************************** ' GetDestinationFile ' This function prompts the user for the name of the destination file to write the para tag ' information to. ' ' PARAMS: ' ' RETURNS: GetDestinationFile AS INTEGER - Integer indicating dialog return value(user selection) ' ************************************************************************************** FUNCTION GetDestinationFile% BEGIN DIALOG OBJECT GetDestinationFileDialog 290, 180, DialogTitle$, SUB GetDestinationFileDialogEventHandler TEXTBOX 100, 55, 175, 13, .DestinationFileTextBox PUSHBUTTON 228, 75, 46, 14, .BrowseButton, "B&rowse..." PUSHBUTTON 135, 160, 46, 14, .BackButton, "< &Back" PUSHBUTTON 181, 160, 46, 14, .NextButton, "&Next >" CANCELBUTTON 234, 160, 46, 14, .CancelButton GROUPBOX 95, 40, 185, 60, .FileGroupBox TEXT 95, 10, 185, 20, .Text1, "" IMAGE 10, 10, 75, 130, .DestinationFileImage GROUPBOX 10, 150, 270, 5, .LineGroupBox END DIALOG GetDestinationFileDialog.SetStyle STYLE_INVISIBLE GetDestinationFileDialog.DestinationFileImage.SetImage "#Step3BMP" GetDestinationFileDialog.DestinationFileImage.SetStyle STYLE_CENTERED GetDestinationFileRet%=DIALOG(GetDestinationFileDialog) SELECT CASE GetDestinationFileRet% CASE DIALOG_RETURN_CANCEL STOP CASE DIALOG_RETURN_NEXT GetDestinationFile = 1 CASE DIALOG_RETURN_BACK IF SelectedApp& = PUBLISH_TO_SCRIPT THEN GetDestinationFile = -2 ELSE GetDestinationFile = -1 ENDIF END SELECT END FUNCTION ' ************************************************************************************** ' GetDestinationFileDialogEventHandler ' This subroutine handles events for the destination file dialog. ' PARAMS: BYVAL ControlID% - Integer indicating the dialog control that is generating a dialog event. ' BYVAL Event% - Integer indicating the dialog event that has occurred in the dialog box ' ************************************************************************************** SUB GetDestinationFileDialogEventHandler(BYVAL ControlID%, BYVAL Event%) STATIC FileBoxType% STATIC DefFile$ STATIC DefExt$ STATIC DefFolder$ IF Event% = EVENT_INITIALIZATION THEN GetDestinationFileDialog.SetStyle STYLE_VISIBLE IF INSTR(OutputFile$, ".") = 0 THEN first% = 1 pos% = 1 WHILE first% <> 0 first% = INSTR(InputFile$, ".", first%) IF first% <> 0 THEN pos% = first% first% = first% + 1 ENDIF WEND StylesFile$ = MID(InputFile$, 1, pos% - 1) SELECT CASE SelectedApp& CASE PUBLISH_TO_VENTURA REM GetDestinationFileDialog.SetText DialogTitle$ GetDestinationFileDialog.FileGroupBox.SetText "Publication Files (*.VP*):" GetDestinationFileDialog.Text1.SetText "What would you like to call the new Corel VENTURA publication?" FileFilter$ = "*.vp*|*.vp" FileBoxType% = 1 DefFile$ = StylesFile$ & "Styles.VP" DefExt$ = ".vp" CASE PUBLISH_TO_QUATTROPRO REM GetDestinationFileDialog.SetText "Style Information Wizard" GetDestinationFileDialog.FileGroupBox.SetText "Quattro Pro Spreadsheet (*.wb3):" GetDestinationFileDialog.Text1.SetText "What would you like to call the Quattro Pro spreadsheet?" FileFilter$ = "*.wb3|*.wb3" FileBoxType% = 0 DefFile$ = StylesFile$ & "Styles.wb3" DefExt$ = ".wb3" CASE PUBLISH_TO_SCRIPT REM GetDestinationFileDialog.SetText "Style Information Wizard" GetDestinationFileDialog.FileGroupBox.SetText "Corel SCRIPT file (*.CSC):" GetDestinationFileDialog.Text1.SetText "What would you like to call the script?." FileFilter$ = "*.csc|*.csc" FileBoxType% = 1 DefFile$ = StylesFile$ & "Styles.csc" DefExt$ = ".csc" CASE PUBLISH_TO_EXCEL REM GetDestinationFileDialog.SetText "Style Information Wizard" GetDestinationFileDialog.FileGroupBox.SetText "MS Excel Spreadsheet (*.XLS):" GetDestinationFileDialog.Text1.SetText "What would you like to call the Excel spreadsheet?" FileFilter$ = "*.xls|*.xls" FileBoxType% = 0 DefFile$ = StylesFile$ & "Styles.xls" DefExt$ = ".xls" CASE PUBLISH_TO_TEXT REM GetDestinationFileDialog.SetText "Style Information Wizard" GetDestinationFileDialog.FileGroupBox.SetText "Text File (*.TXT):" GetDestinationFileDialog.Text1.SetText "What would you like to call the text file?" FileFilter$ = "*.txt|*.txt" FileBoxType% = 1 DefFile$ = StylesFile$ & "Styles.txt" DefExt$ = ".txt" END SELECT OutputFile$ = DefFolder$ & DefFile$ GetDestinationFileDialog.DestinationFileTextBox.SetText OutputFile$ ENDIF ENDIF IF Event% = EVENT_CHANGE_IN_CONTENT THEN SELECT CASE ControlID% CASE GetDestinationFileDialog.DestinationFileTextBox.GetID() ' OutputFile$ = GetDestinationFileDialog.DestinationFileTextBox.GetText() END SELECT ENDIF IF Event% = EVENT_MOUSE_CLICK THEN SELECT CASE ControlID% CASE GetDestinationFileDialog.NextButton.GetID() OutputFile$ = GetDestinationFileDialog.DestinationFileTextBox.GetText() GetDestinationFileDialog.closedialog DIALOG_RETURN_NEXT CASE GetDestinationFileDialog.BackButton.GetID() GetDestinationFileDialog.closedialog DIALOG_RETURN_BACK CASE GetDestinationFileDialog.CancelButton.GetID() GetDestinationFileDialog.closedialog DIALOG_RETURN_CANCEL CASE GetDestinationFileDialog.BrowseButton.GetID() OutFile$ = GETFILEBOX(FileFilter$, , FileBoxType%, DefFile$, DefExt$, DefFolder$) IF OutFile$ <> "" THEN OutputFile$ = OutFile$ GetDestinationFileDialog.DestinationFileTextBox.SetText OutputFile$ END SELECT ENDIF OutputFile$ = GetDestinationFileDialog.DestinationFileTextBox.GetText() IF OutputFile$ = "" OR INSTR(OutputFile$, ".") = 0 THEN GetDestinationFileDialog.NextButton.Enable FALSE ELSE GetDestinationFileDialog.NextButton.Enable TRUE ENDIF END SUB ' ************************************************************************************** ' ShowFinish ' This function displays the finish dialog verifying the files the user has selected. ' ' PARAMS: None ' ' RETURNS: ShowFinish AS INTEGER - Integer indicating dialog return value(user selection) ' ************************************************************************************** FUNCTION ShowFinish% BEGIN DIALOG OBJECT FinishDialog 290, 180, DialogTitle$, SUB FinishDialogEventHandler PUSHBUTTON 181, 160, 46, 14, .FinishButton, "&Finish" PUSHBUTTON 135, 160, 46, 14, .BackButton, "< &Back" CANCELBUTTON 234, 160, 46, 14, .CancelButton TEXT 95, 10, 185, 28, .FinishText, FinishText$ TEXT 95, 125, 185, 12, .Text2, "Click Finish to complete the process." IMAGE 10, 10, 75, 130, .FinishImage GROUPBOX 10, 150, 270, 5, .LineGroupBox TEXT 95, 43, 182, 28, .Text3, FinishText2$ TEXT 95, 105, 185, 20, .Text4, "This may take a few minutes. Please be patient. You will be notified when the process is complete." END DIALOG FinishDialog.SetStyle STYLE_INVISIBLE FinishDialog.FinishImage.SetImage "#LastBMP" FinishDialog.FinishImage.SetStyle STYLE_CENTERED FinishRet%=DIALOG(FinishDialog) IF FinishRet% = DIALOG_RETURN_CANCEL THEN STOP IF FinishRet% = DIALOG_RETURN_NEXT THEN ShowFinish = 1 ENDIF IF FinishRet% = DIALOG_RETURN_BACK THEN ShowFinish = -1 END FUNCTION ' ************************************************************************************** ' FinishDialogEventHandler ' This subroutine handles events for the finish dialog. ' PARAMS: BYVAL ControlID% - Integer indicating the dialog control that is generating a dialog event. ' BYVAL Event% - Integer indicating the dialog event that has occurred in the dialog box ' ************************************************************************************** SUB FinishDialogEventHandler(BYVAL ControlID%, BYVAL Event%) IF Event% = EVENT_INITIALIZATION THEN FinishDialog.SetStyle STYLE_VISIBLE SELECT CASE SelectedApp& CASE PUBLISH_TO_VENTURA FinishText$ = "The Stylesheet Information Wizard is ready to publish your stylesheet information to Corel VENTURA." CASE PUBLISH_TO_QUATTROPRO FinishText$ = "The Stylesheet Information Wizard is ready to publish your paragraph tag information to QuattroPro." FinishText2$ = "You will be able to edit and save changes to the spreadsheet. As well you will be able to apply those changes back to Corel VENTURA." CASE PUBLISH_TO_SCRIPT FinishText$ = "The Stylesheet Information Wizard is ready to publish your paragraph tag information to Corel SCRIPT." FinishText2$ = "You will be able to execute the script and create a new publication with the extracted style information." CASE PUBLISH_TO_EXCEL FinishText$ = "The Stylesheet Information Wizard is ready to publish your paragraph tag information to Excel." FinishText2$ = "You will be able to edit and save changes to the spreadsheet. As well you will be able to apply those changes back to Corel VENTURA." CASE PUBLISH_TO_TEXT FinishText$ = "The Stylesheet Information Wizard is ready to publish your paragraph tag information to a Text File." END SELECT FinishDialog.FinishText.SetText FinishText$ FinishDialog.Text3.SetText FinishText2$ ENDIF IF Event% = EVENT_MOUSE_CLICK THEN SELECT CASE ControlID% CASE FinishDialog.FinishButton.GetID() FinishDialog.closedialog DIALOG_RETURN_NEXT CASE FinishDialog.BackButton.GetID() FinishDialog.closedialog DIALOG_RETURN_BACK CASE FinishDialog.CancelButton.GetID() FinishDialog.closedialog DIALOG_RETURN_CANCEL END SELECT ENDIF END SUB ' ************************************************************************************** ' UseVentura ' This subroutine publishes style info to a new Ventura publication. ' ' PARAMS: None ' ************************************************************************************** SUB UseVentura 'write para tag info to temporary text file TempTextDir$ = GETTEMPFOLDER() TempTextFile$ = TempTextDir$ & "TempTextFile.txt" NEWLINE$ = CHR(13) & CHR(10) TITLE_PREFIX$ = "@Minor Heading = " SECTION_PREFIX$ = "@Main Heading = Paragraph Tag Settings" DIALOG_PREFIX$ = "@Subheading = " TAG_PREFIX$ = "@Minor Heading = " & "Tag Name = " SPACE_CHAR$ = CHR(9) PREFIX_CHAR$ = "@Bullet = " UNITS_PREFIX$ = " " BEGINWAITCURSOR UseTextFile(TempTextFile$) ENDWAITCURSOR BEGINWAITCURSOR WITHOBJECT OBJECT_VENTURA8 .FileNew .FrameFirst TRUE .FileImportText TempTextFile$, , 1 .PageFirstLine .FormatParaTagBegin "Bullet" .FormatParaTabSet 2.50 .FormatParaTagEnd .FileSaveAs OutputFile$ END WITHOBJECT ENDWAITCURSOR KILL TempTextFile$ END SUB ' ************************************************************************************** ' UseScript ' This subroutine creates a script to apply para tag styles to a new pub ' ' PARAMS:None ' ************************************************************************************** SUB UseScript DIM Orientation AS BOOLEAN DIM GutterRuleOverprint AS BOOLEAN ScriptFile$ = OutputFile$ BEGINWAITCURSOR WITHOBJECT OBJECT_VENTURA8 OPEN ScriptFile$ FOR OUTPUT AS 2 WithObjString$ = "WITHOBJECT " & QUOTE & OBJECT_VENTURA8 & QUOTE PRINT #2, WithObjString$ PRINT #2, CHR(13) PRINT #2, ".SetVisible TRUE" PRINT #2, ".FileNew" PRINT #2, ".PageFirstLine" PRINT #2, CHR(13) 'delete default tags PRINT #2, ".ParaTagDelete " & QUOTE & "Bullet" & QUOTE PRINT #2, ".ParaTagDelete " & QUOTE & "Heading" & QUOTE PRINT #2, ".ParaTagDelete " & QUOTE & "Main Heading" & QUOTE PRINT #2, ".ParaTagDelete " & QUOTE & "Subheading" & QUOTE PRINT #2, ".ParaTagDelete " & QUOTE & "Minor Heading" & QUOTE PRINT #2, ".ParaTagDelete " & QUOTE & "Numbered List" & QUOTE PRINT #2, ".ParaTagDelete " & QUOTE & "Z_SEC1" & QUOTE PRINT #2, ".ParaTagDelete " & QUOTE & "Z_SEC2" & QUOTE PRINT #2, CHR(13) 'MASTER PAGE INFORMATION .ViewMasterPage PRINT #2, ".ViewMasterPage" MPCount& = .MasterPageCount() FOR i% = 1 TO MPCount& CurrentMP$ = .MasterPageGetAt(i%) IF UCASE(CurrentMP$) <> UCASE("Default Master") THEN PRINT #2, ".MasterPageAddNew " & QUOTE & CurrentMP$ & QUOTE ENDIF 'get general properties for each master page .FormatMasterPageGet Orientation, PaperType&, MPWidth&, MPHeight&, CurrentMP$ MasterPageStr$ = ".FormatMasterPage " & Orientation & ", " & PaperType& & ", " & MPWidth& & ", " & MPHeight& & ", " & QUOTE & CurrentMP$ & QUOTE PRINT #2, MasterPageStr$ 'get margin settings for LEFT Master page .ViewGotoMasterPage CurrentMP$, FALSE, 4 .FormatFrameMarginsInsideGet 1, LeftMarg&, RightMarg&, TopMarg&, BottomMarg& PRINT #2, ".ViewGotoMasterPage " & QUOTE & CurrentMP$ & QUOTE & ", FALSE, 4" PRINT #2, ".FormatFrameMarginsInside 1, " & LeftMarg& & ", " & RightMarg& & ", " & TopMarg& & ", " & BottomMarg& 'get column settings for LEFT Master page REM .ViewGotoMasterPage CurrentMP$, FALSE, 4 .FormatFrameColumnsGet 1, Columns&, FlowInColumns&, ColumnBalance&, GutterRuleOverprint PRINT #2, ".FormatFrameColumns 1, " & Columns& & ", " & FlowInColumns& & ", " & ColumnBalance& & ", " & GutterRuleOverprint 'get margin settings for RIGHT Master page .ViewGotoMasterPage CurrentMP$, TRUE, 4 .FormatFrameMarginsInsideGet 2, LeftMarg&, RightMarg&, TopMarg&, BottomMarg& PRINT #2, ".ViewGotoMasterPage " & QUOTE & CurrentMP$ & QUOTE & ", TRUE, 4" PRINT #2, ".FormatFrameMarginsInside 2, " & LeftMarg& & ", " & RightMarg& & ", " & TopMarg& & ", " & BottomMarg& 'get Column settings for RIGHT Master page REM .ViewGotoMasterPage CurrentMP$, TRUE, 4 .FormatFrameColumnsGet 2, Columns&, FlowInColumns&, ColumnBalance&, GutterRuleOverprint PRINT #2, ".FormatFrameColumns 2, " & Columns& & ", " & FlowInColumns& & ", " & ColumnBalance& & ", " & GutterRuleOverprint PRINT #2, CHR(13) NEXT i% PRINT #2, ".ViewPageLayout" PRINT #2, CHR(13) 'PARAGRAPH TAG INFORMATION .ViewPageLayout NumTags%=.ParaTagCount() FOR i%=1 TO NumTags% NameOfTag$=.ParaTagGetAt(i%) IF NameOfTag$ = "" THEN GOTO AllDone .FormatParaTagBegin NameOfTag$ PRINT #2, "REM " & NameOfTag$ NameOfTag$ = QUOTE & LTRIM(NameOfTag$) & QUOTE bt% = INSTR(NameOfTag$, "Body Text") 'Don't make new tag for body text IF bt%=0 THEN PRINT #2, ".ParaTagAddNew " & NameOfTag$ PRINT #2, ".FormatParaTagBegin " & NameOfTag$ 'ALIGNMENT///////////////////////////////////////////////////////////////////////////////////////////////// DIM FrameWideText As BOOLEAN DIM AddPrev AS BOOLEAN .FormatParaAlignmentGet Hor&, Vert&, FrameWideText, RPFromLeft&, RPFromRight&, LPFromLeft&, LPFromRight&, LinesToIndent&, FirstLinesIndent&, AddPrev, DecFromRight&, DecimalChar&, AbsoluteYPosition& AlignmentStr1$ = ".FormatParaAlignment " & (Hor) & ", " & (Vert) & ", " & (FrameWideText) & ", " & (RPFromLeft) & ", " & (RPFromRight) & ", " AlignmentStr2$ = (LPFromLeft) & ", " & (LPFromRight) & ", " & (LinesToIndent) & ", " & (FirstLinesIndent) & ", " & (AddPrev) & ", " & (DecFromRight) & ", " & (DecimalChar) & ", " & (AbsoluteYPosition) AlignmentStr$ = AlignmentStr1$ & AlignmentStr2$ PRINT #2, AlignmentStr$ 'BREAKS ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// DIM InLineWithPrev AS BOOLEAN DIM AllowBreakWithin AS BOOLEAN DIM KeepWithNext AS BOOLEAN DIM KeepWithPrev AS BOOLEAN .FormatParaBreaksGet PageBreak&, ColumnBreak&, LineBreak&, InLineWithPrev, AllowBreakWithin, KeepWithNext, KeepWithPrev BreaksStr$ = ".FormatParaBreaks " & (PageBreak) & ", " & (ColumnBreak) & ", " & (LineBreak) & ", " & (InLineWithPrev) & ", " & (AllowBreakWithin) & ", " & (KeepWithNext) & ", " & (KeepWithPrev) PRINT #2, BreaksStr$ 'BULLETS/////////////////////////////////////////////////////////////////////////////////////////////////// DIM IndentFirstLineOnly AS BOOLEAN .FormatParaBulletGet Indent&, BulletChar&, ShiftUpDef&, IndentFirstLineOnly BulletStr$ = ".FormatParaBullet " & (Indent) & ", " & (BulletChar) & ", " & (ShiftUpDef) & ", " & (IndentFirstLineOnly) PRINT #2, BulletStr$ 'COLOUR//////////////////////////////////////////////////////////////////////////////////////////////////////// DIM Background AS BOOLEAN DIM COverprint AS BOOLEAN DIM ColumnWide AS BOOLEAN .FormatParaColorGet BackGround, ColorModel&, Colour1&, Colour2&, Colour3&, Colour4&, COverprint, ColumnWide ColorStr$ = ".FormatParaColor " & (BackGround) & ", " & (ColorModel) & ", " & (Colour1) & ", " & (Colour2) & ", " & (Colour3) & ", " & (Colour4) & ", " & (COverprint)& ", " & (ColumnWide) PRINT #2, ColorStr$ 'DEFAULTS//////////////////////////////////////////////////////////////////////////////////////////////////////// DIM AADefault AS BOOLEAN .FormatParaDefaultsGet AADefault, ColsToSpan&, NextTag$, OverscoreThick&, OverscoreShift&, StrikeThick&, StrikeShift&, ULine1Thick&, ULine1Shift&, ULine2Thick&, ULine2Shift&, SuperscriptPS!, SuperscriptShift&, SubscriptPS!, SubscriptShift& IF NextTag$ <> "" THEN NextTag$ = QUOTE & NextTag$ & QUOTE DefaultStr1$ = ".FormatParaDefaults " & (AADefault) & ", " & (ColsToSpan&) & ", " & NextTag$ & ", " & (OverscoreThick&) & ", " DefaultStr2$ = (OverscoreShift&) & ", " & (StrikeThick&) & ", " & (StrikeShift&) & ", " & (ULine1Thick&) & ", " & (ULine1Shift&) & ", " DefaultStr3$ = (ULine2Thick&) & ", " & (ULine2Shift&) & ", " & (SuperscriptPS!) & ", " & (SuperscriptShift&) & ", " & (SubscriptPS!) & ", " & (SubscriptShift&) DefaultStr$ = DefaultStr1$ & DefaultStr2$ & DefaultStr3$ PRINT #2, DefaultStr$ 'DROPCAPS//////////////////////////////////////////////////////////////////////////////////////////////////////// .FormatParaDropCapGet CharCount&, ShiftUpDropCap&, CustomLineCount& DropCapsStr$ = ".FormatParaDropCap " & (CharCount) & ", " & (ShiftUpDropCap) & ", " & (CustomLineCount) PRINT #2, DropCapsStr$ 'EFFECT FONT//////////////////////////////////////////////////////////////////////////////////////////////////// DIM bEffectStrike AS BOOLEAN DIM bEffectOverscore AS BOOLEAN DIM bEffectItalic AS BOOLEAN .FormatParaEffectFontGet EffectFontName$, EffectPointSize!, EffectWeight&, bEffectItalic, EffectUnderline&, bEffectStrike, bEffectOverscore IF EffectFontName$ <> "" THEN EffectFontName$ = QUOTE & EffectFontName$ & QUOTE EffectFontStr$ = ".FormatParaEffectFont " & EffectFontName & ", " & (EffectPointSize) & ", " & (EffectWeight) & ", " & (bEffectItalic)& ", " & (EffectUnderline) & ", " & (bEffectStrike) & ", " & (bEffectOverscore) PRINT #2, EffectFontStr$ 'EFFECT COLOUR//////////////////////////////////////////////////////////////////////////////////////////////////////// DIM EffectBackground AS BOOLEAN DIM Overprint AS BOOLEAN .FormatParaEffectColorGet EffectBackGround, ColorModel&, Colour1&, Colour2&, Colour3&, Colour4&, Overprint EffectColorStr$ = ".FormatParaEffectColor " & (EffectBackGround) & ", " & (ColorModel) & ", " & (Colour1) & ", " & (Colour2) & ", " & (Colour3) & ", " & (Colour4) & ", " & (Overprint) PRINT #2, EffectColorStr$ 'EFFECT//////////////////////////////////////////////////////////////////////////////////////////////////////// .FormatParaEffectsGet EffectType&, TextAfter$, TextBefore$ IF TextAfter$ <> "" THEN TextAfter$ = QUOTE & TextAfter$ & QUOTE IF TextBefore$ <> "" THEN TextBefore$ = QUOTE & TextBefore$ & QUOTE EffectsStr$ = ".FormatParaEffects " & (EffectType) & ", " & TextAfter$ & ", " & TextBefore$ PRINT #2, EffectsStr$ 'FONT////////////////////////////////////////////////////////////////////////////////////////////////////////// DIM bItalic AS BOOLEAN DIM bStrikeThru AS BOOLEAN DIM bOverscore AS BOOLEAN DIM bUppercase AS BOOLEAN .FormatParaFontGet FontName$, PointSize!, Weight&, bItalic, Underline&, bStrikeThru, bOverscore, bUppercase IF FontName$ <> "" THEN FontName$ = QUOTE & FontName$ & QUOTE FontStr$ = ".FormatParaFont " & FontName$ & ", " & (PointSize) & ", " & (Weight) & ", " & (bItalic) & ", " & (Underline) & ", " & (bStrikeThru) & ", " & (bOverscore) & ", " & (bUppercase) PRINT #2, FontStr$ 'HYPHENATION//////////////////////////////////////////////////////////////////////////////////////////////////////// DIM Automatic AS BOOLEAN DIM AtPageEnd AS BOOLEAN DIM AtLastWord AS BOOLEAN DIM ForCapital AS BOOLEAN .FormatParaHyphenationGet Automatic, Dict$, SuccessiveHyphs&, MinWordSize&, MinCharsBefore&, MinCharsAfter&, AtPageEnd, AtLastWord, ForCapital IF Dict$ <> "" THEN Dict$ = QUOTE & Dict$ & QUOTE HyphenationStr1$ = ".FormatParaHyphenation " & (Automatic) & ", " & Dict$ & ", " & (SuccessiveHyphs&) & ", " & (MinWordSize) & ", " & (MinCharsBefore) & ", " HyphenationStr2$ = (MinCharsAfter) & ", " & (AtPageEnd) & ", " & (AtLastWord) & ", " & (ForCapital) HyphenationStr$ = HyphenationStr1$ & HyphenationStr2$ PRINT #2, HyphenationStr$ 'SPACING/////////////////////////////////////////////////////////////////////////////////////////////////////////// DIM GrowInterline AS BOOLEAN DIM AddAbove AS BOOLEAN DIM AddAboveOnly AS BOOLEAN .FormatParaSpacingGet SpaceAfter&, SpaceBefore&, SpaceInterLine&, SpaceInterPara&, AASpace&, GrowInterline, AddAbove, AddAboveOnly, RotationAngle&, RotationHeight& SpacingStr1$ = ".FormatParaSpacing " & (SpaceAfter) & ", " & (SpaceBefore) & ", " & (SpaceInterLine) & ", " & (SpaceInterPara) & ", " & (AASpace&) & ", " SpacingStr2$ = (GrowInterline) & ", " & (AddAbove) & ", " & (AddAboveOnly) & ", " & (RotationAngle) & ", " & (RotationHeight) SpacingStr$ = SpacingStr1$ & SpacingStr2$ PRINT #2, SpacingStr$ 'TAB AT/////////////////////////////////////////////////////////////////////////////////////////////////////////// DIM Leader AS BOOLEAN .FormatParaTabGetAt Position&, Location!, Align&, Leader, LeaderChar&, LeaderSpacing& TabSetStr$ = ".FormatParaTabSet " & (Location) & ", " & (Align) & ", " & (Leader) & ", " & (LeaderChar) & ", " & (LeaderSpacing) PRINT #2, TabSetStr$ 'TYPOGRAPHY/////////////////////////////////////////////////////////////////////////////////////////////////////////// DIM LetterSpace AS BOOLEAN DIM Kerning AS BOOLEAN .FormatParaTypographyGet WordSpace&, MinWordSpace&, MaxWordSpace&, LetterSpace, MaxLetterSpace&, VJAbove&, VJBelow&, VJInterline&, Kerning TypographyStr1$ = ".FormatParaTypography " & (WordSpace) & ", " & (MinWordSpace) & ", " & (MaxWordSpace) & ", " & (LetterSpace) & ", " & (MaxLetterSpace) & ", " TypographyStr2$ = (VJAbove) & ", " & (VJBelow) & ", " & (VJInterline) & ", " & (Kerning) TypographyStr$ = TypographyStr1$ & TypographyStr2$ PRINT #2, TypographyStr$ PRINT #2, ".FormatParaTagEnd" PRINT #2, CHR(13) NEXT i% PRINT #2, "END WITHOBJECT" AllDone: CLOSE(2) END WITHOBJECT ENDWAITCURSOR MESSAGE ScriptFile$ & CHR(13) & "has been created." END SUB ' ************************************************************************************** ' UseQP ' This subroutine publishes style info to a Quattro Pro spreadsheet. ' ' PARAMS: None ' ************************************************************************************** SUB UseQP 'write para tag info to temporary text file TempTextDir$ = GETTEMPFOLDER() TempTextFile$ = TempTextDir$ & "TempTextFile.txt" NEWLINE$ = CHR(13) TITLE_PREFIX$ = "@Title = " SECTION_PREFIX$ = "@Section = Paragraph Tag Settings" DIALOG_PREFIX$ = "@Dialog = " TAG_PREFIX$ = "@Tag Name = " SPACE_CHAR$ = SPACE(8) PREFIX_CHAR$ = SPACE(8) UNITS_PREFIX$ = " *" BEGINWAITCURSOR UseTextFile(TempTextFile$) ENDWAITCURSOR BEGINWAITCURSOR UpdateQPMacro ENDWAITCURSOR 'read temporary text file and write para tag info to a QP spreadsheet OPEN TempTextFile$ FOR INPUT AS 1 'Get title of publication GetLine VPDir$ 'Get name of QP workbook GetLine QPName$ 'Get title of publication GetLine TitleText$ pos% = INSTR(TitleText$, "=") lgth% = LEN(TitleText$) TitleText$ = MID(TitleText$, pos% + 2, lgth% - pos%) 'Get section name GetLine SectionText$ pos% = INSTR(SectionText$, "=") SectionText$ = MID(SectionText$, pos%+1) column% = 0 row% = 4 'Launch QP and create a new spreadsheet with para tag information BEGINWAITCURSOR WITHOBJECT "QuattroPro.PerfectScript" .FileNew .PUT "A:A1..IV999", 1, 0, TitleText$ 'column, row .PUT "A:A1..IV999", 1, 1, SectionText$ .PUT "A:A1..IV999", 0, 4, "Units" 'first column, fifth row DO GetLine InText$ 'Ignore if a blank line IF InText$ <> "" THEN 'check for tag name or dialog label apos% = INSTR(InText$, "@") IF apos% <> 0 THEN pos% = INSTR(InText$, "=") ELSE pos% = INSTR(InText$, ":") ENDIF lgth% = LEN(InText$) DescText$= MID(InText$, apos%+1, pos% -1) DescText$= LTRIM(DescText$) CText$= MID(InText$, pos%+1, lgth%-pos%) CText$= LTRIM(CText$) 'start a new row for each new tag name pos% = INSTR(DescText$, "Tag Name =") IF pos% <> 0 THEN column% = 0 row% = row% + 1 ENDIF 'dialog headings pos% = INSTR(DescText$, "Dialog =") IF pos% <> 0 THEN pos% = INSTR(CText$, ":") lgth% = LEN(CText$) DText$= MID(CText$, pos%+1 , lgth%-pos%) dcolumn% = column% .PUT "A:A1..IV999", dcolumn%, 2, DText$ ELSE .PUT "A:A1..IV999", column%, 3, DescText$ pos% = INSTR(CText, " *") 'check for parameter UNITS IF pos <> 0 THEN .PUT "A:A1..IV999", column%, row%, MID(CText, 1, pos% - 1) 'parameter values .PUT "A:A1..IV999", column%, 4, MID(CText, pos% + 2) 'parameter UNITS ELSE .PUT "A:A1..IV999", column%, row%, CText$ 'parameter values ENDIF column% = column% + 1 ENDIF ENDIF LOOP UNTIL EOF(1) 'insert auto close macro to run on exit from file or application ExitScript$ = CHR(123) & "playperfectscript " & QUOTE & QPFile$ & QUOTE & CHR(125) .BlockName_Create "_nbexitmacro", "A:A1..A:A1" .PUT "A:A1..A:A1", 0, 0, ExitScript$ .FileSaveAs OutputFile$ ENDWAITCURSOR MESSAGE "Listing completed successfully." & CHR(13) & "You will be prompted on close to apply changes to a new Ventura publication." END WITHOBJECT CLOSE 'close text file KILL TempTextFile$ END SUB ' ************************************************************************************** ' UpDateQPMacro ' This subroutine creates the PerfectScript macro used by QuattroPro to extract the ' para tag info from the spreadsheet and bring it back into Ventura ' PARAMS:None ' ************************************************************************************** SUB UpDateQPMacro first% = 1 pos% = 1 WHILE first% <> 0 first% = INSTR(OutputFile$, ".", first%) IF first% <> 0 THEN pos% = first% first% = first% + 1 ENDIF WEND QPFile$ = MID(OutputFile$, 1, pos% - 1) QPFile$ = QPFile$ & ".wcm" KILL QPFile$ WAIT FOR 1 WITHOBJECT "WordPerfect.PerfectScript" .AppMinimize .FileNew .SingleSmartQuote 1053 '(OpenSingleQuote: 1053) .SingleSmartQuote 1052 '(CloseSingleQuote: 1052) .DoubleSmartQuote 1056 .DoubleSmartQuote 1055 .Type "RegKey = RegistryOpenKey(LocalMachine!; " & QUOTE & VENTURA_REGQUERY_CONST & QUOTE & ")" .HardReturn .Type "VPDir:=RegistryQueryValue(RegKey; " & QUOTE & "Destination" & QUOTE & ")" .HardReturn .Type "BMPFile:= VPDir + " & QUOTE & "\Ventura\Scripts\Bitmaps\Step2bmp.bmp" & QUOTE .HardReturn .Type "WBFile := " & QUOTE & OutputFile$ & QUOTE .HardReturn .HardReturn .Type "//Prompt user to save workbook file" .HardReturn .Type "NewWBFile := FileNameDialog(StyleOptions:SaveAsDialog!; InitialFileName:WBFile)" .HardReturn .Type "IF (NewWBFile != " & QUOTE & QUOTE & ")" .HardReturn .Type " WBFile := NewWBFile" .HardReturn .Type "ENDIF" .HardReturn .HardReturn .Type "Yes := 6" .HardReturn .Type "No := 7" .HardReturn .Type "//prompt user to apply hanges to Ventura" .HardReturn .Type "ans = MessageBox(Status:x; Caption:" & QUOTE & "QuattroPro" & QUOTE & "; Message:" & QUOTE & "Would you like to apply changes to VENTURA?" & QUOTE & "; YesNo!|IconQuestion!)" .HardReturn .HardReturn .Type "IF(ans = No)" .HardReturn .Type " QUIT" .HardReturn .Type "ELSE" .HardReturn .HardReturn .Type "//Get temp text file location" .HardReturn .Type "TempPathLength= 255" .HardReturn .Type "TempPath = STRFILL( 255; " & QUOTE & SPACE(1) & QUOTE & ")" .HardReturn .Type "DLLLoad(WinHand; " & QUOTE & "Kernel32.dll" & QUOTE & " )" .HardReturn .Type "DLLCall( WinHand; " & QUOTE & "GetTempPathA" & QUOTE & "; PathLength; Integer!; {TempPathLength; ADDRESS(TempPath)})" .HardReturn .Type "TempPath =STRTRIM(TempPath; PathLength-1; TrimLeft!)" .HardReturn .Type "DLLFree(WinHand)" .HardReturn .Type "TempTextFile = TempPath + " & QUOTE & "TempTextFile.txt" & QUOTE .HardReturn .HardReturn REM .Type "WaitMsgInit()" .HardReturn .Type "WaitMsgDisplay (" & QUOTE & "Reading spreadsheet..." & QUOTE & ")" .HardReturn .Type "//Launch QP and open workbook file" .HardReturn .Type "APPLICATION (QuattroPro; " & QUOTE & "QuattroPro" & QUOTE & "; Default;" & QUOTE & "US" & QUOTE & ")" .HardReturn .Type "FILEOPEN(WBFile)" .HardReturn .HardReturn .Type "//Open temp text file for writing from start of file" .HardReturn .Type "TextFile = OPENFILE( TempTextFile; Write!; None!; AnsiText!)" .HardReturn .Type "FILEPOSITION(TextFile; 0; FromBeginning!)" .HardReturn .HardReturn .Type "//Get title of publication and section name and write to file" .HardReturn .Type "SelectBlock (" & QUOTE & "A:A1..IV999" & QUOTE & ")" .HardReturn .Type "c=" & QUOTE & "1" & QUOTE .HardReturn .Type "r=" & QUOTE & "0" & QUOTE .HardReturn .Type "TitleText = GetCellValue(+" & QUOTE & "C(" & QUOTE & "+c+" & QUOTE & ")R(" & QUOTE & "+r+" & QUOTE & ")" & QUOTE & ")" .HardReturn .Type "TitleText = " & QUOTE & "@Title = " & QUOTE & "+ GetCellValue(+" & QUOTE & "C(" & QUOTE & "+c+" & QUOTE & ")R(" & QUOTE & "+r+" & QUOTE & ")" & QUOTE & ")" .HardReturn .Type "r= " & QUOTE & "1" & QUOTE .HardReturn .Type "SectionText = GetCellValue(+" & QUOTE & "C(" & QUOTE & "+c+" & QUOTE & ")R(" & QUOTE & "+r+" & QUOTE & ")" & QUOTE & ")" .HardReturn .Type "SectionText = " & QUOTE & "@Section = " & QUOTE & " + SectionText" .HardReturn .Type "BlankLine = " & QUOTE & QUOTE .HardReturn .Type "FILEWRITE(TextFile; " & QUOTE & "QUATTROPRO" & QUOTE & "; NewLine!;)" .HardReturn .Type "FILEWRITE(TextFile; TitleText; NewLine!;)" .HardReturn .Type "FILEWRITE(TextFile; TitleText; NewLine!;)" .HardReturn .Type "FILEWRITE(TextFile; SectionText; NewLine!;)" .HardReturn .Type "FILEWRITE(TextFile; BlankLine; NewLine!;)" .HardReturn .HardReturn .Type " r := 5" .HardReturn .Type " //LOOP for every tag" .HardReturn .Type " REPEAT" .HardReturn .Type " c := 0" .HardReturn .Type " TagName = GetCellValue(+" & QUOTE & "C(" & QUOTE & "+c+" & QUOTE & ")R(" & QUOTE & "+r+" & QUOTE & ")" & QUOTE & ")" .HardReturn .Type " IF (TagName = " & QUOTE & QUOTE & ")" .HardReturn .Type " FileExit(DoSave?:No!)" .HardReturn .Type " AppExecute(CommandLine:VPDir + " & QUOTE & "\Ventura\Scripts\NewStyle.exe" & QUOTE & ")" .HardReturn .Type " RETURN" .HardReturn .Type " ENDIF" .HardReturn .HardReturn .Type " TagName := " & QUOTE & "@TagName = " & QUOTE & " + TagName" .HardReturn .Type " FILEWRITE(TextFile; BlankLine; NewLine!;)" .HardReturn .Type " FILEWRITE(TextFile; TagName; NewLine!;)" .HardReturn .Type " c := 1" .HardReturn .Type " REPEAT" .HardReturn .Type " //get dialog label (row 3)" .HardReturn .Type " DialogLabel := GetCellValue(+" & QUOTE & "C(" & QUOTE & "+c+" & QUOTE & ")R(2)" & QUOTE & ")" .HardReturn .Type " IF (DialogLabel != " & QUOTE & QUOTE & ")" .HardReturn .Type " DialogLabel := " & QUOTE & "@Dialog = Paragraph Properties : " & QUOTE & " + DialogLabel" .HardReturn .Type " FILEWRITE(TextFile; BlankLine; NewLine!;)" .HardReturn .Type " FILEWRITE(TextFile; DialogLabel; NewLine!;)" .HardReturn .Type " ENDIF" .HardReturn .HardReturn .Type " AttributeLabel := GetCellValue(+" & QUOTE & "C(" & QUOTE & "+c+" & QUOTE & ")R(3)" & QUOTE & ")" .HardReturn .Type " AttributeValue := GetCellValue(+" & QUOTE & "C(" & QUOTE & "+c+" & QUOTE & ")R(" & QUOTE & "+r+" & QUOTE & ")" & QUOTE & ")" .HardReturn .Type " AttributeUnit := GetCellValue(+" & QUOTE & "C(" & QUOTE & "+c+" & QUOTE & ")R(4)" & QUOTE & ")" .HardReturn .Type " IF (AttributeLabel != " & QUOTE & QUOTE & ")" .HardReturn .Type " IF (AttributeUnit != " & QUOTE & QUOTE & ")" .HardReturn .Type " AttributeString := " & QUOTE & " " & QUOTE & "+ AttributeLabel + " & QUOTE & ": " & QUOTE & " + AttributeValue + " & QUOTE & " *" & QUOTE & " + AttributeUnit" .HardReturn .Type " ELSE" .HardReturn .Type " AttributeString := " & QUOTE & " " & QUOTE & "+ AttributeLabel + " & QUOTE & ": " & QUOTE & " + AttributeValue" .HardReturn .Type " ENDIF" .HardReturn .Type " FILEWRITE(TextFile; AttributeString; NewLine!;)" .HardReturn .Type " ENDIF" .HardReturn .Type " c = c + 1" .HardReturn .Type " UNTIL (AttributeLabel = " & QUOTE & QUOTE & ")" .HardReturn .Type " r = r + 1 // go to next row" .HardReturn .Type " UNTIL (TagName = " & QUOTE & QUOTE & ")" .HardReturn .Type " FileClose(DoSave?:No!)" .HardReturn .Type " CLOSEFILE" .HardReturn .Type "ENDIF" .HardReturn .Type "WaitMsgHide()" .HardReturn .Type "RETURN" .HardReturn .HardReturn .Type "//****************************************" .HardReturn .Type "// PROCEDURE: WaitMsgInit ()" .HardReturn .Type "// PURPOSE: Initializes macro wait messages." .HardReturn .Type "//****************************************" .HardReturn .Type "PROCEDURE WaitMsgInit()" .HardReturn .Type "DialogDefine (" & QUOTE & "WaitMsg" & QUOTE & "; 50; 50; 150; 36; 16; " & QUOTE & "Please Wait" & QUOTE & ")" .HardReturn .Type "DialogAddText (" & QUOTE & "WaitMsg" & QUOTE & "; " & QUOTE & "WaitText" & QUOTE & "; 8; 14; 144; 16; 1; " & QUOTE & QUOTE & ")" .HardReturn .Type "DialogLoad (" & QUOTE & "WaitMsg" & QUOTE & ")" .HardReturn .Type "Return" .HardReturn .Type "ENDPROC" .HardReturn .HardReturn .Type "//****************************************" .HardReturn .Type "// PROCEDURE: WaitMsgDisplay (Text)" .HardReturn .Type "// PURPOSE: Displays a previously defined wait message dialog." .HardReturn .Type "//****************************************" .HardReturn .Type "PROCEDURE WaitMsgDisplay (Text)" .HardReturn .Type "RegionSetWindowText (" & QUOTE & "WaitMsg" & QUOTE & " + " & QUOTE & ".WaitText" & QUOTE & "; Text)" .HardReturn .Type "DialogShow (" & QUOTE & "WaitMsg" & QUOTE & ";; WaitDlgCallBack)" .HardReturn .Type "ENDPROC" .HardReturn .HardReturn .Type "PROCEDURE WaitDlgCallBack ()" .HardReturn .Type "If (WaitDlgCallBack[5] = 274 And WaitDlgCallBack[6] = 61536)" .HardReturn .Type " Assert (CancelCondition!)" .HardReturn .Type "EndIf" .HardReturn .Type "ENDPROC" .HardReturn .HardReturn .Type "//****************************************" .HardReturn .Type "// PROCEDURE: WaitMsgHide" .HardReturn .Type "// PURPOSE: Hides a previously defined wait message dialog." .HardReturn .Type "//****************************************" .HardReturn .Type "PROCEDURE WaitMsgHide ()" .HardReturn .Type "DialogUndisplay (" & QUOTE & "WaitMsg" & QUOTE & "; " & QUOTE & "WaitText" & QUOTE & ")" .HardReturn .Type "ENDPROC" .HardReturn .HardReturn .FileSave QPFile$ .ExitWordPerfect END WITHOBJECT WAIT FOR 2 END SUB ' ************************************************************************************** ' UseExcel ' This subroutine writes style info to a text file, then launches Excel and ' reads the style info from the text file into Excel ' ' PARAMS:None ' ************************************************************************************** SUB UseExcel ON ERROR GOTO ErrorHandler 'create file to use as Excel auto close macro CreateAutoCloseFile 'create string for macro [ExcelPar.xls] MacroLocale$ = VenturaDir$ & "\Ventura\Scripts\ExcelPar.xls" IF INSTR(MacroLocale$, " ") <> 0 THEN 'no spaces in path, don't use quotes MacroLocale$ = QUOTE & MacroLocale$ & QUOTE 'spaces in path, enclose in quotes ENDIF 'create string for executable command [Excel path + Excel macro name and path] ExcelPath$ = REGISTRYQUERY(HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\EXCEL.EXE","") exeName$ = ExcelPath$ & " " & MacroLocale$ 'write para tag info to temporary text file TempTextDir$ = GETTEMPFOLDER() TempTextFile$ = TempTextDir$ & "TempTextFile.txt" NEWLINE$ = CHR(13) TITLE_PREFIX$ = "@Title = " SECTION_PREFIX$ = "@Section = Paragraph Tag Properties" DIALOG_PREFIX$ = "@Dialog = " TAG_PREFIX$ = "@Tag Name = " SPACE_CHAR$ = SPACE(8) PREFIX_CHAR$ = SPACE(8) UNITS_PREFIX$ = " *" BEGINWAITCURSOR UseTextFile(TempTextFile$) ENDWAITCURSOR 'launch Excel and execute macro BEGINWAITCURSOR STARTPROCESS(exeName$) ENDWAITCURSOR 'launch Excel and execute macro REM BEGINWAITCURSOR REM WinID& = FindWindow("XLMAIN", 0) REM WinID& = FindWindow("XLMAIN", 0) REM IF WinID& <> 0 THEN 'Excel is open REM x& = ShellExecute(WinID&, "open", MacroLocale$, "", "", SW_SHOWNORMAL ) REM ELSE REM STARTPROCESS(exeName$) REM ENDIF REM REM ENDWAITCURSOR SubEnd: EXIT SUB ErrorHandler: SELECT CASE ErrNum CASE ELSE MESSAGE "Error" & STR(ErrNum) RESUME AT SubEnd END SELECT END SUB ' ************************************************************************************** ' CreateAutoCloseFile ' This subroutine creatyes the AutoClose macro used by Excel to extract the ' para tag info from the spreadsheet and bring it back into Ventura ' PARAMS:None ' ************************************************************************************** SUB CreateAutoCloseFile CLOSE 'open text file to write code to for Excel autoclose macro TempTextDir$ = GETTEMPFOLDER() AutoCloseFile$ = TempTextDir$ & "SaveCode.txt" OPEN AutoCloseFile$ FOR OUTPUT AS 1 PRINT #1, "Declare Function GetTempPath Lib " & QUOTE & "kernel32" & QUOTE & "Alias" & QUOTE & "GetTempPathA" & QUOTE & "(ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long" PRINT #1, "'this sub runs when the file is closed and promts the user whether to to apply changes to Ventura" PRINT #1, "Sub Auto_Close()" PRINT #1, PRINT #1, "On Error Resume Next" PRINT #1, "SheetNum = 1" PRINT #1, "With Worksheets(SheetNum)" PRINT #1, " Worksheets(SheetNum).Activate" PRINT #1, " TitleText = .Cells(1, 2).Formula" PRINT #1, "End With" PRINT #1, PRINT #1, "Msg = " & QUOTE & "Do you want to save changes to " & QUOTE & " + TitleText + " & QUOTE & "?" & QUOTE PRINT #1, "Style = vbYesNoCancel + vbQuestion + vbDefaultButton2" PRINT #1, "Title = " & QUOTE & "Microsoft Excel" & QUOTE PRINT #1, PRINT #1, "SaveResponse = MsgBox(Msg, Style, Title)" PRINT #1, "If SaveResponse = vbYes Then" PRINT #1, " fileSaveName = Application.GetSaveAsFilename(fileFilter:=" & QUOTE & "Microsoft Excel Workbook (*.xls), *.xls" & QUOTE & ")" PRINT #1, " If fileSaveName <> False Then" PRINT #1, " ActiveWorkbook.SaveAs filename:=fileSaveName" PRINT #1, " End If" PRINT #1, "ElseIf SaveResponse = vbCancel Then" PRINT #1, " Workbooks(TitleText).Activate" PRINT #1, " Exit Sub" PRINT #1, "End If" PRINT #1, PRINT #1, "Msg = " & QUOTE & "Do you want to apply changes to VENTURA ?" & QUOTE PRINT #1, "Style = vbYesNoCancel + vbQuestion + vbDefaultButton2" PRINT #1, "Title = " & QUOTE & "Microsoft Excel" & QUOTE PRINT #1, PRINT #1, "ApplyResponse = MsgBox(Msg, Style, Title)" PRINT #1, "If ApplyResponse = vbYes Then" PRINT #1, " ApplyChanges" PRINT #1, " ActiveWorkbook.Close saveChanges:=False" PRINT #1, "ElseIf ApplyResponse = vbCancel Then" PRINT #1, " Exit Sub" PRINT #1, "Else" PRINT #1, " ActiveWorkbook.Close saveChanges:=False" PRINT #1, "End If" PRINT #1, "End Sub" PRINT #1, PRINT #1, PRINT #1, "Sub ApplyChanges()" PRINT #1, "Dim TempPath$" PRINT #1, "Dim TempPathLength&" PRINT #1, "TempPath$ = Space(255)" PRINT #1, "TempPathLength& = 255" PRINT #1, "PathLength& = GetTempPath(TempPathLength&, TempPath$)" PRINT #1, "TempPath$ = Left$(TempPath$, PathLength&)" PRINT #1, "TempFile$ = " & "TempPath$" & " + "& QUOTE & "TempTextFile.TXT" & QUOTE PRINT #1, "If PathLength& > 0 Then" PRINT #1, " ChDir (TempPath$)" PRINT #1, "Else" PRINT #1, " MsgBox ("& QUOTE & "Cannot locate temporary directory" & QUOTE & ")" PRINT #1, " Stop" PRINT #1, "End If" PRINT #1, PRINT #1, "SheetNum = 1" PRINT #1, "With Worksheets(SheetNum)" PRINT #1, "Close" PRINT #1, "Open TempFile$ For Output As #1" PRINT #1, "Worksheets(SheetNum).Activate" PRINT #1, "TitleText = .Cells(1, 2).Formula" PRINT #1, " SectionText = .Cells(2, 2).Formula" PRINT #1, "Print #1, " & QUOTE & "EXCEL" & QUOTE PRINT #1, "Print #1, " & QUOTE & "EXCEL" & QUOTE PRINT #1, "Print #1, " & QUOTE & "@Title = " & QUOTE & "; TitleText" PRINT #1, "Print #1, " & QUOTE & "@Section = " & QUOTE & "; SectionText" PRINT #1, "Print #1," PRINT #1, "r = 6" PRINT #1, "c = 1" PRINT #1, "'LOOP for every tag" PRINT #1, "Do" PRINT #1, " TagName = .Cells(r, 1).Formula" PRINT #1, " If TagName = " & QUOTE & QUOTE & " Then Exit Do" PRINT #1, " Print #1," PRINT #1, " Print #1, " & QUOTE & "@TagName = " & QUOTE & "; TagName" PRINT #1, " c = 2" PRINT #1, " Do" PRINT #1, " DialogLabel = .Cells(3, c).Formula" PRINT #1, " If DialogLabel <> " & QUOTE & QUOTE & " Then" PRINT #1, " Print #1," PRINT #1, " Print #1, " & QUOTE & "@Dialog = Paragraph Properties : " & QUOTE & "; DialogLabel" PRINT #1, " End If" PRINT #1, " AttributeLabel = .Cells(4, c).Formula" PRINT #1, " AttributeValue = .Cells(r, c).Formula" PRINT #1, " AttributeUnit = .Cells(5, c).Formula" PRINT #1, " If AttributeLabel <> " & QUOTE & QUOTE & " Then" PRINT #1, " If AttributeUnit <> " & QUOTE & QUOTE & " Then" PRINT #1, " Print #1, Spc(5); AttributeLabel; Spc(5); AttributeValue; " & QUOTE & " *" & QUOTE & "; AttributeUnit" PRINT #1, " Else" PRINT #1, " Print #1, Spc(5); AttributeLabel; Spc(5); AttributeValue" PRINT #1, " End If" PRINT #1, " End If" PRINT #1, " c = c + 1" PRINT #1, " Loop Until AttributeLabel = " & QUOTE & QUOTE PRINT #1, " r = r + 1" PRINT #1, "Loop Until TagName = " & QUOTE & QUOTE PRINT #1, "Close #1" PRINT #1, "End With" PRINT #1, "RetVal = Shell(" & QUOTE & VenturaDir$ & "\VENTURA\SCRIPTS\NEWSTYLE.EXE" & QUOTE & ", 1)" PRINT #1, "End Sub" CLOSE END SUB ' ************************************************************************************** ' UseTextFile ' This function obtains the para tag information for each Paragraph tag in the specified ' publication, and writes this information to the specified text file. ' ' PARAMS: Name of text file to use ' ' RETURNS: UseTextFile AS INTEGER - Integer indicating dialog return value(user selection) ' ************************************************************************************** SUB UseTextFile(TextFile$) WITHOBJECT OBJECT_VENTURA8 CLOSE ' close any text files that might have been left open OPEN TextFile$ FOR OUTPUT AS 1 NameOfPub$=UCASE(InputFile$) 'print directories to text file if outputting to a spreadsheet IF SelectedApp& = PUBLISH_TO_QUATTROPRO OR SelectedApp& = PUBLISH_TO_EXCEL THEN PRINT #1, VenturaDir$ & NEWLINE$ PRINT #1, OutputFile$ & NEWLINE$ ENDIF PRINT #1, TITLE_PREFIX$ & NameOfPub$ & NEWLINE$ 'display master page settings if outputting to Ventura or Text file IF SelectedApp& = PUBLISH_TO_VENTURA OR SelectedApp& = PUBLISH_TO_TEXT THEN PRINT #1, "@Main Heading = Page Tag Properties" & NEWLINE$ MPCount& = .MasterPageCount() ' get settings for each master page FOR i% = 1 TO MPCount& CurrentMP$ = .MasterPageGetAt(i%) GetMasterPageGeneral CurrentMP$ 'get general master page settings PRINT #1, DIALOG_PREFIX$ & "Page Tag Properties : Left Page Margins" & NEWLINE$ GetMasterPageMargins CurrentMP$, FALSE 'get margin settings for LEFT Master page PRINT #1, DIALOG_PREFIX$ & "Page Tag Properties : Right Page Margins" & NEWLINE$ GetMasterPageMargins CurrentMP$, TRUE 'get margin settings for RIGHT Master page PRINT #1, DIALOG_PREFIX$ & "Page Tag Properties : Left Page Columns" & NEWLINE$ GetMasterPageColumns CurrentMP$, FALSE 'get column settings for LEFT Master page PRINT #1, DIALOG_PREFIX$ & "Page Tag Properties : Right Page Columns" & NEWLINE$ GetMasterPageColumns CurrentMP$, TRUE 'get column settings for RIGHT Master page NEXT i% ENDIF .ViewPageLayout ' make sure PageLayout view is active 'heading for paragraph tag settings PRINT #1, SECTION_PREFIX$ & NEWLINE$ NumTags%=.ParaTagCount() 'get total number of tags in the publication ' get para tag attributes for every para tag FOR i%=1 TO NumTags% TagName$=.ParaTagGetAt(i) IF TagName$ = "" THEN GOTO AllDone PRINT #1, CHR(13) PRINT #1, CHR(13) PRINT #1, TAG_PREFIX$ & TagName$ & NEWLINE$ .FormatParaTagBegin TagName$ ' specify which tag to get attributes for GetParaFontInfo ' get paragraph font attributes GetParaColorInfo FALSE ' get paragraph color attributes for FONT GetParaColorInfo TRUE ' get paragraph color attributes for BACKGROUND GetParaEffects ' get paragraph effects GetEffectFontInfo ' get paragraph effect font attributes GetEffectColorInfo FALSE ' get paragraph effect font color attributes for FONT GetEffectColorInfo TRUE ' get paragraph effect font color attributes for BACKGROUND GetParaAlignmentInfo ' get paragraph alignment attributes GetParaSpacingInfo ' get paragraph spacing attributes GetParaTabInfo ' get paragraph tab attributes GetParaBreaksInfo ' get paragraph breaks attributes GetParaHyphenationInfo ' get paragraph hyphenation attributes GetParaTypographyInfo ' get paragraph typography attributes GetParaDefaultsInfo ' get paragraph default attributes PRINT #1, NEWLINE$ ' NEXT i AllDone: IF CloseVal&=1 THEN .FileClose 2 'Close vent pub if user wants to CLOSE 1 'Close text file END WITHOBJECT END SUB ' ************************************************************************************** ' GetMasterPageGeneral ' This subroutine obtains the general settings for the master page specified by MasterPageName$, ' and prints the information to the open text file ' ' PARAMS: MasterPageName$ - the name of the master page from which attributes are to be obtained ' ************************************************************************************** SUB GetMasterPageGeneral(MasterPageName$) DIM Orientation AS BOOLEAN WITHOBJECT OBJECT_VENTURA8 .FormatMasterPageGet Orientation, PaperType&, Width&, Height&, MasterPageName$ PRINT #1, "@Minor Heading = " & "Page Tag Name = " & MasterPageName$ & NEWLINE$ PRINT #1, DIALOG_PREFIX$ & "Page Tag Properties : General" & NEWLINE$ IF Orientation = FALSE THEN PRINT #1, PREFIX_CHAR$ & "Page Orientation: " & SPACE_CHAR$ & "Landscape" & NEWLINE$ ELSE PRINT #1, PREFIX_CHAR$ & "Page Orientation: " & SPACE_CHAR$ & "Portrait" & NEWLINE$ END IF SELECT CASE PaperType& CASE 0 : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "Letter" & NEWLINE$ CASE 1 : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "Legal" & NEWLINE$ CASE 2 : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "Tabloid" & NEWLINE$ CASE 3 : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "Statement/Half" & NEWLINE$ CASE 4 : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "Executive" & NEWLINE$ CASE 5 : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "Fan fold" & NEWLINE$ CASE 6 : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "Double" & NEWLINE$ CASE 7 : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "Broad sheet" & NEWLINE$ CASE 8 : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "A2" & NEWLINE$ CASE 9 : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "A3" & NEWLINE$ CASE 10 : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "A4" & NEWLINE$ CASE 11 : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "A5" & NEWLINE$ CASE 12 : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "A6" & NEWLINE$ CASE 13 : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "B4" & NEWLINE$ CASE 14 : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "B5" & NEWLINE$ CASE 15 : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "C3" & NEWLINE$ CASE 16 : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "C4" & NEWLINE$ CASE 17 : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "C5" & NEWLINE$ CASE 18 : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "C6" & NEWLINE$ CASE 19 : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "RA2" & NEWLINE$ CASE 20 : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "RA3" & NEWLINE$ CASE 21 : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "RA4" & NEWLINE$ CASE 22 : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "SRA3" & NEWLINE$ CASE 23 : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "SRA4" & NEWLINE$ CASE 24 : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "Envelope #9" & NEWLINE$ CASE 25 : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "Envelope #10" & NEWLINE$ CASE 26 : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "Envelope #11" & NEWLINE$ CASE 27 : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "Envelope #12" & NEWLINE$ CASE 28 : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "Envelope #14" & NEWLINE$ CASE 29 : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "Envelope monarch" & NEWLINE$ CASE 30 : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "Envelope check" & NEWLINE$ CASE 31 : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "DL" & NEWLINE$ CASE 32 : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "German fan fold" & NEWLINE$ CASE 33 : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "German legal fan fold" & NEWLINE$ CASE 34 : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "Custom" & NEWLINE$ CASE ELSE : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "Unknown" & NEWLINE$ END SELECT DBLWidth# = CDBL(Width&) ConvertTo DimensionUnits&, DBLWidth# PRINT #1, PREFIX_CHAR$ & "Page Width: " & SPACE_CHAR$ & DBLWidth# & UNITS_PREFIX$ & Units$(DimensionUnits&) & NEWLINE$ DBLHeight# = CDBL(Height&) ConvertTo DimensionUnits&, DBLHeight# PRINT #1, PREFIX_CHAR$ & "Page Height: " & SPACE_CHAR$ & DBLHeight# & UNITS_PREFIX$ & Units$(DimensionUnits&) & NEWLINE$ END WITHOBJECT END SUB ' ************************************************************************************** ' GetMasterPageMargins ' This subroutine obtains the margin settings for the master page specified by MasterPageName$, ' and prints the information to the open text file ' ' PARAMS: MasterPageName$ - the name of the master page from which attributes are to be obtained ' PageType AS BOOLEAN - indicates whether to use the left or right master page ' - FALSE - use LEFT page ' - TRUE - use RIGHT page ' ************************************************************************************** SUB GetMasterPageMargins(MasterPageName$, PageType AS BOOLEAN) WITHOBJECT OBJECT_VENTURA8 .ViewMasterPage 'switch to master page view .ViewGotoMasterPage MasterPageName$, PageType, 4 'activate the specified master page .FormatFrameMarginsInsideGet 1, LeftMarg&, RightMarg&, TopMarg&, BottomMarg& DBLTopMarg# = CDBL(TopMarg&) ConvertTo MarginUnits&, DBLTopMarg# PRINT #1, PREFIX_CHAR$ & "Top: " & SPACE_CHAR$ & DBLTopMarg# & UNITS_PREFIX$ & Units$(MarginUnits&) & NEWLINE$ DBLBottomMarg# = CDBL(BottomMarg&) ConvertTo MarginUnits&, DBLBottomMarg# PRINT #1, PREFIX_CHAR$ & "Bottom: " & SPACE_CHAR$ & DBLBottomMarg# & UNITS_PREFIX$ & Units$(MarginUnits&) & NEWLINE$ DBLLeftMarg# = CDBL(LeftMarg&) ConvertTo MarginUnits&, DBLLeftMarg# PRINT #1, PREFIX_CHAR$ & "Left: " & SPACE_CHAR$ & DBLLeftMarg# & UNITS_PREFIX$ & Units$(MarginUnits&) & NEWLINE$ DBLRightMarg# = CDBL(RightMarg&) ConvertTo MarginUnits&, DBLRightMarg# PRINT #1, PREFIX_CHAR$ & "Right: " & SPACE_CHAR$ & DBLRightMarg# & UNITS_PREFIX$ & Units$(MarginUnits&) & NEWLINE$ END WITHOBJECT END SUB ' ************************************************************************************** ' GetMasterPageColumns ' This subroutine obtains the column settings for the master page specified by MasterPageName$, ' and prints the information to the open text file ' ' PARAMS: MasterPageName$ - the name of the master page from which attributes are to be obtained ' PageType AS BOOLEAN - indicates whether to use the left or right master page ' - FALSE - use LEFT page ' - TRUE - use RIGHT page ' ************************************************************************************** SUB GetMasterPageColumns(MasterPageName$, PageType AS BOOLEAN) DIM GutterRuleOverprint AS BOOLEAN WITHOBJECT OBJECT_VENTURA8 .ViewMasterPage .ViewGotoMasterPage MasterPageName$, PageType, 4 .FormatFrameColumnsGet 1, Columns&, FlowInColumns&, ColumnBalance&, GutterRuleOverprint PRINT #1, PREFIX_CHAR$ & "Number of Columns: " & SPACE_CHAR$ & Columns& & NEWLINE$ SELECT CASE FlowInColumns& CASE 1 : PRINT #1, PREFIX_CHAR$ & "Flow In Columns: " & SPACE_CHAR$ & "left to right" & NEWLINE$ CASE 2 : PRINT #1, PREFIX_CHAR$ & "Flow In Columns: " & SPACE_CHAR$ & "right to left" & NEWLINE$ END SELECT SELECT CASE ColumnBalance& CASE 0 : PRINT #1, PREFIX_CHAR$ & "Column Balance: " & SPACE_CHAR$ & "Off" & NEWLINE$ CASE 1 : PRINT #1, PREFIX_CHAR$ & "Column Balance: " & SPACE_CHAR$ & "On" & NEWLINE$ CASE 2 : PRINT #1, PREFIX_CHAR$ & "Column Balance: " & SPACE_CHAR$ & "Default" & NEWLINE$ END SELECT IF GutterRuleOverprint = -1 THEN 'temp fix for Booleans; replace -1 with TRUE when fixed PRINT #1, PREFIX_CHAR$ & "Gutter Rule Overprint: " & SPACE_CHAR$ & "ON" & NEWLINE$ ELSE PRINT #1, PREFIX_CHAR$ & "Gutter Rule Overprint: " & SPACE_CHAR$ & "OFF" & NEWLINE$ ENDIF IF Columns& > 1 THEN FOR j% = 1 TO Columns& -1 'last column doesn't have gutter properties .FormatFrameColumnGetAt 1, j%, Width&, GutterWidth&, RuleWidth&, ColorModel&, Color1&, Color2&, Color3&, Color4& DBLWidth# = CDBL(Width&) ConvertTo MarginUnits&, DBLWidth# PRINT #1, PREFIX_CHAR$ & "Column " & j% & " Width: " & SPACE_CHAR$ & DBLWidth# & UNITS_PREFIX$ & Units$(MarginUnits&) & NEWLINE$ DBLGutterWidth# = CDBL(GutterWidth&) ConvertTo LineUnits&, DBLGutterWidth# PRINT #1, PREFIX_CHAR$ & "Column " & j% & " Gutter Width: " & SPACE_CHAR$ & DBLGutterWidth# & UNITS_PREFIX$ & Units$(LineUnits&) & NEWLINE$ DBLRuleWidth# = CDBL(RuleWidth&) ConvertTo LineUnits&, DBLRuleWidth# PRINT #1, PREFIX_CHAR$ & "Column " & j% & " Gutter Rule Width: " & SPACE_CHAR$ & DBLRuleWidth# & UNITS_PREFIX$ & Units$(LineUnits&) & NEWLINE$ NEXT j% .FormatFrameColumnGetAt 1, j%, Width& DBLWidth# = CDBL(Width&) ConvertTo MarginUnits&, DBLWidth# PRINT #1, PREFIX_CHAR$ & "Column " & j% & " Width: " & SPACE_CHAR$ & DBLWidth# & UNITS_PREFIX$ & Units$(MarginUnits&) & NEWLINE$ ENDIF END WITHOBJECT END SUB ' ************************************************************************************** ' GetParaFontInfo ' This subroutine obtains the paragraph font information for the active paragraph tag ' ************************************************************************************** SUB GetParaFontInfo DIM StrikeThru AS BOOLEAN DIM Overscore AS BOOLEAN DIM Uppercase AS BOOLEAN DIM Italic AS BOOLEAN WITHOBJECT OBJECT_VENTURA8 PRINT #1, DIALOG_PREFIX$ & "Paragraph Properties : Font" & NEWLINE$ .FormatParaFontGet FontName$, PointSize!, Weight&, Italic, Underline&, StrikeThru, Overscore, Uppercase PRINT #1, PREFIX_CHAR$ & "Font Name: " & SPACE_CHAR$ & FontName$ & NEWLINE$ DBLPointSize# = CDBL(PointSize!) ConvertTo FontUnits&, FROMPOINTS(DBLPointSize#) Round DBLPointSize#, .010 PRINT #1, PREFIX_CHAR$ & "Point Size: " & SPACE_CHAR$ & DBLPointSize# & UNITS_PREFIX$ & Units$(FontUnits&) & NEWLINE$ SELECT CASE Weight& CASE 100 : PRINT #1, PREFIX_CHAR$ & "Weight: " & SPACE_CHAR$ & "Thin" & NEWLINE$ CASE 200 : PRINT #1, PREFIX_CHAR$ & "Weight: " & SPACE_CHAR$ & "Extra Light, Ultra Light" & NEWLINE$ CASE 300 : PRINT #1, PREFIX_CHAR$ & "Weight: " & SPACE_CHAR$ & "Light" & NEWLINE$ CASE 400 : PRINT #1, PREFIX_CHAR$ & "Weight: " & SPACE_CHAR$ & "Normal, Regular" & NEWLINE$ CASE 500 : PRINT #1, PREFIX_CHAR$ & "Weight: " & SPACE_CHAR$ & "Medium" & NEWLINE$ CASE 600 : PRINT #1, PREFIX_CHAR$ & "Weight: " & SPACE_CHAR$ & "Semi Bold, Demi Bold" & NEWLINE$ CASE 700 : PRINT #1, PREFIX_CHAR$ & "Weight: " & SPACE_CHAR$ & "Bold" & NEWLINE$ CASE 800 : PRINT #1, PREFIX_CHAR$ & "Weight: " & SPACE_CHAR$ & "Extra Bold, Ultra Bold" & NEWLINE$ CASE 900 : PRINT #1, PREFIX_CHAR$ & "Weight: " & SPACE_CHAR$ & "Black, Heavy" & NEWLINE$ CASE ELSE : PRINT #1, PREFIX_CHAR$ & "Weight: " & SPACE_CHAR$ & "Unknown" & NEWLINE$ END SELECT IF Italic = -1 THEN 'temp fix for Booleans; replace -1 with TRUE when fixed PRINT #1, PREFIX_CHAR$ & "Italic: " & SPACE_CHAR$ & "ON" & NEWLINE$ ELSE PRINT #1, PREFIX_CHAR$ & "Italic: " & SPACE_CHAR$ & "OFF" & NEWLINE$ ENDIF 'Text Before and After are properties of the Font dialog and should appear here .FormatParaEffectsGet EffectType&, TextAfter$, TextBefore$ PRINT #1, PREFIX_CHAR$ & "Text Before: " & SPACE_CHAR$ & TextBefore$ & NEWLINE$ PRINT #1, PREFIX_CHAR$ & "Text After: " & SPACE_CHAR$ & TextAfter$ & NEWLINE$ SELECT CASE Underline& CASE 0 : PRINT #1, PREFIX_CHAR$ & "Underline: " & SPACE_CHAR$ & "None" & NEWLINE$ CASE 1 : PRINT #1, PREFIX_CHAR$ & "Underline: " & SPACE_CHAR$ & "Single" & NEWLINE$ CASE 2 : PRINT #1, PREFIX_CHAR$ & "Underline: " & SPACE_CHAR$ & "Double" & NEWLINE$ CASE 3 : PRINT #1, PREFIX_CHAR$ & "Underline: " & SPACE_CHAR$ & "Word underline" & NEWLINE$ CASE ELSE : PRINT #1, PREFIX_CHAR$ & "Underline: " & SPACE_CHAR$ & "Unknown" & NEWLINE$ END SELECT IF StrikeThru = -1 THEN 'temp fix for Booleans; replace -1 with TRUE when fixed PRINT #1, PREFIX_CHAR$ & "Strike Thru: " & SPACE_CHAR$ & "ON" & NEWLINE$ ELSE PRINT #1, PREFIX_CHAR$ & "Strike Thru: " & SPACE_CHAR$ & "OFF" & NEWLINE$ ENDIF IF Overscore = -1 THEN 'temp fix for Booleans; replace -1 with TRUE when fixed PRINT #1, PREFIX_CHAR$ & "Overscore: " & SPACE_CHAR$ & "ON" & NEWLINE$ ELSE PRINT #1, PREFIX_CHAR$ & "Overscore: " & SPACE_CHAR$ & "OFF" & NEWLINE$ ENDIF IF Uppercase = -1 THEN 'temp fix for Booleans; replace -1 with TRUE when fixed PRINT #1, PREFIX_CHAR$ & "Uppercase: " & SPACE_CHAR$ & "ON" & NEWLINE$ ELSE PRINT #1, PREFIX_CHAR$ & "Uppercase: " & SPACE_CHAR$ & "OFF" & NEWLINE$ ENDIF END WITHOBJECT END SUB ' ************************************************************************************** ' GetParaColorInfo ' This subroutine obtains the paragraph color information for the active paragraph tag ' ************************************************************************************** SUB GetParaColorInfo(Background AS BOOLEAN) REM DIM BackGround AS BOOLEAN DIM Overprint AS BOOLEAN DIM ColumnWide AS BOOLEAN WITHOBJECT OBJECT_VENTURA8 .FormatParaColorGet BackGround, ColorModel&, Colour1&, Colour2&, Colour3&, Colour4&, Overprint, ColumnWide IF Background = -1 THEN 'temp fix for Booleans; replace -1 with TRUE when fixed PRINT #1, DIALOG_PREFIX$ & "Paragraph Properties : Background Color" & NEWLINE$ REM PRINT #1, PREFIX_CHAR$ & "Background: " & SPACE_CHAR$ & "ON" & NEWLINE$ ELSE PRINT #1, DIALOG_PREFIX$ & "Paragraph Properties : Font Color" & NEWLINE$ REM PRINT #1, PREFIX_CHAR$ & "Background: " & SPACE_CHAR$ & "OFF" & NEWLINE$ ENDIF SELECT CASE ColorModel& CASE 2 : PRINT #1, PREFIX_CHAR$ & "Color Model: " & SPACE_CHAR$ & "CMYK" & NEWLINE$ CASE 3 : PRINT #1, PREFIX_CHAR$ & "Color Model: " & SPACE_CHAR$ & "CMYK255" & NEWLINE$ CASE 4 : PRINT #1, PREFIX_CHAR$ & "Color Model: " & SPACE_CHAR$ & "CMY" & NEWLINE$ CASE 5 : PRINT #1, PREFIX_CHAR$ & "Color Model: " & SPACE_CHAR$ & "RGB" & NEWLINE$ CASE 6 : PRINT #1, PREFIX_CHAR$ & "Color Model: " & SPACE_CHAR$ & "HSB" & NEWLINE$ CASE 7 : PRINT #1, PREFIX_CHAR$ & "Color Model: " & SPACE_CHAR$ & "HLS" & NEWLINE$ CASE 9 : PRINT #1, PREFIX_CHAR$ & "Color Model: " & SPACE_CHAR$ & "Grayscale" & NEWLINE$ CASE 11 : PRINT #1, PREFIX_CHAR$ & "Color Model: " & SPACE_CHAR$ & "YIQ" & NEWLINE$ CASE 12 : PRINT #1, PREFIX_CHAR$ & "Color Model: " & SPACE_CHAR$ & "L*a*b*" & NEWLINE$ CASE 13 : PRINT #1, PREFIX_CHAR$ & "Color Model: " & SPACE_CHAR$ & "Registration Color" & NEWLINE$ CASE ELSE : PRINT #1, PREFIX_CHAR$ & "Color Model: " & SPACE_CHAR$ & "Unavailable" & NEWLINE$ ColorModel& = 0 : Colour1& = 0 : Colour2& = 0 : Colour3& = 0 : Colour4& = 0 END SELECT PRINT #1, PREFIX_CHAR$ & "Color 1: " & SPACE_CHAR$ & (Colour1&) & NEWLINE$ PRINT #1, PREFIX_CHAR$ & "Color 2: " & SPACE_CHAR$ & (Colour2&) & NEWLINE$ PRINT #1, PREFIX_CHAR$ & "Color 3: " & SPACE_CHAR$ & (Colour3&) & NEWLINE$ PRINT #1, PREFIX_CHAR$ & "Color 4: " & SPACE_CHAR$ & (Colour4&) & NEWLINE$ IF Overprint = -1 THEN 'temp fix for Booleans; replace -1 with TRUE when fixed PRINT #1, PREFIX_CHAR$ & "Overprint: " & SPACE_CHAR$ & "ON" & NEWLINE$ ELSE PRINT #1, PREFIX_CHAR$ & "Overprint: " & SPACE_CHAR$ & "OFF" & NEWLINE$ ENDIF ' only print ColumnWide param if background color IF Background = -1 THEN 'temp fix for Booleans; replace -1 with TRUE when fixed IF ColumnWide = -1 THEN 'temp fix for Booleans; replace -1 with TRUE when fixed PRINT #1, PREFIX_CHAR$ & "Column Wide: " & SPACE_CHAR$ & "ON" & NEWLINE$ ELSE PRINT #1, PREFIX_CHAR$ & "Column Wide: " & SPACE_CHAR$ & "OFF" & NEWLINE$ ENDIF ENDIF END WITHOBJECT END SUB ' ************************************************************************************** ' GetParaEffects ' This subroutine obtains the effects information for the active paragraph tag ' IF Effect type is Bullet, the paragraph bullet attributes are obtained. ' IF Effect type is Drop Caps, the paragraph bullet attributes are obtained. ' ************************************************************************************** SUB GetParaEffects WITHOBJECT OBJECT_VENTURA8 PRINT #1, DIALOG_PREFIX$ & "Paragraph Properties : Effects" & NEWLINE$ 'Text Before and After now appears with the Font properties .FormatParaEffectsGet EffectType& ', TextAfter$, TextBefore$ SELECT CASE EffectType& CASE 0 : PRINT #1, PREFIX_CHAR$ & "Effect Type: " & SPACE_CHAR$ & "None" & NEWLINE$ CASE 1 : PRINT #1, PREFIX_CHAR$ & "Effect Type: " & SPACE_CHAR$ & "Bullet" & NEWLINE$ CASE 2 : PRINT #1, PREFIX_CHAR$ & "Effect Type: " & SPACE_CHAR$ & "Drop Cap" & NEWLINE$ CASE ELSE : PRINT #1, PREFIX_CHAR$ & "Effect Type: " & SPACE_CHAR$ & "Unknown" & NEWLINE$ END SELECT IF EffectType& = 1 THEN 'IF Effect Type is Bullet, get Bullet attributes GetBulletInfo ELSEIF EffectType& = 2 THEN 'IF Effect Type is Drop Caps, get Drop Caps attributes GetDropCapsInfo ELSE 'ELSE only print property headings if spreadsheet IF SelectedApp& = PUBLISH_TO_EXCEL OR SelectedApp& = PUBLISH_TO_QUATTROPRO THEN 'property headings for Bullets PRINT #1, DIALOG_PREFIX$ & "Paragraph Properties : Bullets" & NEWLINE$ PRINT #1, PREFIX_CHAR$ & "Indent: " PRINT #1, PREFIX_CHAR$ & "Bullet Character: " PRINT #1, PREFIX_CHAR$ & "Shift Up: " PRINT #1, PREFIX_CHAR$ & "Indent First Line Only: " 'property headings for Drop Caps PRINT #1, DIALOG_PREFIX$ & "Paragraph Properties : DropCaps" & NEWLINE$ PRINT #1, PREFIX_CHAR$ & "Character Count: " PRINT #1, PREFIX_CHAR$ & "Shift Up: " PRINT #1, PREFIX_CHAR$ & "Custom Line Count: " ENDIF ENDIF END WITHOBJECT END SUB ' ************************************************************************************** ' GetBulletInfo ' This subroutine obtains the Bullet attributes for the active paragraph tag ' ************************************************************************************** SUB GetBulletInfo DIM IndentFirstLineOnly As BOOLEAN WITHOBJECT OBJECT_VENTURA8 .FormatParaBulletGet Indent&, BulletChar&, ShiftUpDef&, IndentFirstLineOnly PRINT #1, DIALOG_PREFIX$ & "Paragraph Properties : Bullets" & NEWLINE$ DBLIndent# = CDBL(Indent&) ConvertTo VerticalUnits&, DBLIndent# PRINT #1, PREFIX_CHAR$ & "Indent: " & SPACE_CHAR$ & DBLIndent# & UNITS_PREFIX$ & Units$(VerticalUnits&) & NEWLINE$ PRINT #1, PREFIX_CHAR$ & "Bullet Character: " & SPACE_CHAR$ & (BulletChar&) & UNITS_PREFIX$ & "ANSI" & NEWLINE$ DBLShiftUpDef# = CDBL(ShiftUpDef&) ConvertTo HorizontalUnits&, DBLShiftUpDef# PRINT #1, PREFIX_CHAR$ & "Shift Up: " & SPACE_CHAR$ & DBLShiftUpDef# & UNITS_PREFIX$ & Units$(HorizontalUnits&) & NEWLINE$ IF IndentFirstLineOnly = -1 THEN 'temp fix for Booleans; replace -1 with TRUE when fixed PRINT #1, PREFIX_CHAR$ & "Indent First Line Only: " & SPACE_CHAR$ & "ON" & NEWLINE$ ELSE PRINT #1, PREFIX_CHAR$ & "Indent First Line Only: " & SPACE_CHAR$ & "OFF" & NEWLINE$ ENDIF IF SelectedApp& = PUBLISH_TO_EXCEL OR SelectedApp& = PUBLISH_TO_QUATTROPRO THEN 'property headings for Drop Caps PRINT #1, DIALOG_PREFIX$ & "Paragraph Properties : DropCaps" & NEWLINE$ PRINT #1, PREFIX_CHAR$ & "Character Count: " PRINT #1, PREFIX_CHAR$ & "Shift Up: " PRINT #1, PREFIX_CHAR$ & "Custom Line Count: " ENDIF END WITHOBJECT END SUB ' ************************************************************************************** ' GetDropCapsInfo ' This subroutine obtains the Drop Cap attributes for the active paragraph tag ' ************************************************************************************** SUB GetDropCapsInfo WITHOBJECT OBJECT_VENTURA8 IF SelectedApp& = PUBLISH_TO_EXCEL OR SelectedApp& = PUBLISH_TO_QUATTROPRO THEN 'property headings for Bullets PRINT #1, DIALOG_PREFIX$ & "Paragraph Properties : Bullets" & NEWLINE$ PRINT #1, PREFIX_CHAR$ & "Indent: " PRINT #1, PREFIX_CHAR$ & "Bullet Character: " PRINT #1, PREFIX_CHAR$ & "Shift Up: " PRINT #1, PREFIX_CHAR$ & "Indent First Line Only: " ENDIF .FormatParaDropCapGet CharCount&, ShiftUpDropCap&, CustomLineCount& PRINT #1, DIALOG_PREFIX$ & "Paragraph Properties : DropCaps" & NEWLINE$ PRINT #1, PREFIX_CHAR$ & "Character Count: " & SPACE_CHAR$ & (CharCount&) & NEWLINE$ DBLShiftUpDropCap# = CDBL(ShiftUpDropCap&) ConvertTo HorizontalUnits&, DBLShiftUpDropCap# PRINT #1, PREFIX_CHAR$ & "Shift Up: " & SPACE_CHAR$ & DBLShiftUpDropCap# & UNITS_PREFIX$ & Units$(HorizontalUnits&) & NEWLINE$ PRINT #1, PREFIX_CHAR$ & "Custom Line Count: " & SPACE_CHAR$ & (CustomLineCount&) & NEWLINE$ END WITHOBJECT END SUB ' ************************************************************************************** ' GetEffectFontInfo ' This subroutine obtains the Effect font attributes for the active paragraph tag ' ************************************************************************************** SUB GetEffectFontInfo DIM bEffectStrike AS BOOLEAN DIM bEffectOverscore AS BOOLEAN DIM bEffectItalic AS BOOLEAN WITHOBJECT OBJECT_VENTURA8 .FormatParaEffectFontGet EffectFontName$, EffectPointSize!, EffectWeight&, bEffectItalic, EffectUnderline&, bEffectStrike, bEffectOverscore PRINT #1, DIALOG_PREFIX$ & "Paragraph Properties : Effect Font" & NEWLINE$ PRINT #1, PREFIX_CHAR$ & "Effect Font Name: " & SPACE_CHAR$ & EffectFontName$ & NEWLINE$ DBLEffectPointSize# = CDBL(EffectPointSize!) ConvertTo FontUnits&, FROMPOINTS(DBLEffectPointSize#) Round DBLEffectPointSize#, .010 PRINT #1, PREFIX_CHAR$ & "Effect Point Size: " & SPACE_CHAR$ & DBLEffectPointSize# & UNITS_PREFIX$ & Units$(FontUnits&) & NEWLINE$ SELECT CASE EffectWeight& CASE 100 : PRINT #1, PREFIX_CHAR$ & "Effect Weight: " & SPACE_CHAR$ & "Thin" & NEWLINE$ CASE 200 : PRINT #1, PREFIX_CHAR$ & "Effect Weight: " & SPACE_CHAR$ & "Extra Light, Ultra Light" & NEWLINE$ CASE 300 : PRINT #1, PREFIX_CHAR$ & "Effect Weight: " & SPACE_CHAR$ & "Light" & NEWLINE$ CASE 400 : PRINT #1, PREFIX_CHAR$ & "Effect Weight: " & SPACE_CHAR$ & "Normal, Regular" & NEWLINE$ CASE 500 : PRINT #1, PREFIX_CHAR$ & "Effect Weight: " & SPACE_CHAR$ & "Medium" & NEWLINE$ CASE 600 : PRINT #1, PREFIX_CHAR$ & "Effect Weight: " & SPACE_CHAR$ & "Semi Bold, Demi Bold" & NEWLINE$ CASE 700 : PRINT #1, PREFIX_CHAR$ & "Effect Weight: " & SPACE_CHAR$ & "Bold" & NEWLINE$ CASE 800 : PRINT #1, PREFIX_CHAR$ & "Effect Weight: " & SPACE_CHAR$ & "Extra Bold, Ultra Bold" & NEWLINE$ CASE 900 : PRINT #1, PREFIX_CHAR$ & "Effect Weight: " & SPACE_CHAR$ & "Black, Heavy" & NEWLINE$ CASE ELSE : PRINT #1, PREFIX_CHAR$ & "Effect Weight: " & SPACE_CHAR$ & "Unknown" & NEWLINE$ END SELECT IF bEffectItalic = -1 THEN 'temp fix for Booleans; replace -1 with TRUE when fixed PRINT #1, PREFIX_CHAR$ & "Italic: " & SPACE_CHAR$ & "ON" & NEWLINE$ ELSE PRINT #1, PREFIX_CHAR$ & "Italic: " & SPACE_CHAR$ & "OFF" & NEWLINE$ ENDIF SELECT CASE EffectUnderline& CASE 0 : PRINT #1, PREFIX_CHAR$ & "Underline: " & SPACE_CHAR$ & "None" & NEWLINE$ CASE 1 : PRINT #1, PREFIX_CHAR$ & "Underline: " & SPACE_CHAR$ & "Single" & NEWLINE$ CASE 2 : PRINT #1, PREFIX_CHAR$ & "Underline: " & SPACE_CHAR$ & "Double" & NEWLINE$ CASE 3 : PRINT #1, PREFIX_CHAR$ & "Underline: " & SPACE_CHAR$ & "Word underline" & NEWLINE$ CASE ELSE : PRINT #1, PREFIX_CHAR$ & "Underline: " & SPACE_CHAR$ & "Unknown" & NEWLINE$ END SELECT IF bEffectStrike = -1 THEN 'temp fix for Booleans; replace -1 with TRUE when fixed PRINT #1, PREFIX_CHAR$ & "Strike Thru: " & SPACE_CHAR$ & "ON" & NEWLINE$ ELSE PRINT #1, PREFIX_CHAR$ & "Strike Thru: " & SPACE_CHAR$ & "OFF" & NEWLINE$ ENDIF IF bEffectOverscore = -1 THEN 'temp fix for Booleans; replace -1 with TRUE when fixed PRINT #1, PREFIX_CHAR$ & "Overscore: " & SPACE_CHAR$ & "ON" & NEWLINE$ ELSE PRINT #1, PREFIX_CHAR$ & "Overscore: " & SPACE_CHAR$ & "OFF" & NEWLINE$ ENDIF END WITHOBJECT END SUB ' ************************************************************************************** ' GetEffectColorInfo ' This subroutine obtains the Effect color attributes for the active paragraph tag ' ************************************************************************************** SUB GetEffectColorInfo(EffectBackGround AS BOOLEAN) REM DIM EffectBackGround AS BOOLEAN DIM ECOverprint AS BOOLEAN WITHOBJECT OBJECT_VENTURA8 .FormatParaEffectColorGet EffectBackGround, ColorModel&, Colour1&, Colour2&, Colour3&, Colour4&, ECOverprint IF EffectBackGround = -1 THEN 'temp fix for Booleans; replace -1 with TRUE when fixed PRINT #1, DIALOG_PREFIX$ & "Paragraph Properties : Effect Background Color" & NEWLINE$ ' PRINT #1, PREFIX_CHAR$ & "Background: " & SPACE_CHAR$ & "ON" & NEWLINE$ ELSE PRINT #1, DIALOG_PREFIX$ & "Paragraph Properties : Effect Font Color" & NEWLINE$ ' PRINT #1, PREFIX_CHAR$ & "Background: " & SPACE_CHAR$ & "OFF" & NEWLINE$ ENDIF SELECT CASE ColorModel& CASE 2 : PRINT #1, PREFIX_CHAR$ & "Color Model: " & SPACE_CHAR$ & "CMYK" & NEWLINE$ CASE 3 : PRINT #1, PREFIX_CHAR$ & "Color Model: " & SPACE_CHAR$ & "CMYK255" & NEWLINE$ CASE 4 : PRINT #1, PREFIX_CHAR$ & "Color Model: " & SPACE_CHAR$ & "CMY" & NEWLINE$ CASE 5 : PRINT #1, PREFIX_CHAR$ & "Color Model: " & SPACE_CHAR$ & "RGB" & NEWLINE$ CASE 6 : PRINT #1, PREFIX_CHAR$ & "Color Model: " & SPACE_CHAR$ & "HSB" & NEWLINE$ CASE 7 : PRINT #1, PREFIX_CHAR$ & "Color Model: " & SPACE_CHAR$ & "HLS" & NEWLINE$ CASE 9 : PRINT #1, PREFIX_CHAR$ & "Color Model: " & SPACE_CHAR$ & "Grayscale" & NEWLINE$ CASE 11 : PRINT #1, PREFIX_CHAR$ & "Color Model: " & SPACE_CHAR$ & "YIQ" & NEWLINE$ CASE 12 : PRINT #1, PREFIX_CHAR$ & "Color Model: " & SPACE_CHAR$ & "L*a*b*" & NEWLINE$ CASE 13 : PRINT #1, PREFIX_CHAR$ & "Color Model: " & SPACE_CHAR$ & "Registration Color" & NEWLINE$ CASE ELSE : PRINT #1, PREFIX_CHAR$ & "Color Model: " & SPACE_CHAR$ & "Unavailable" & NEWLINE$ ColorModel& = 0 : Colour1& = 0 : Colour2& = 0 : Colour3& = 0 : Colour4& = 0 END SELECT PRINT #1, PREFIX_CHAR$ & "Color 1: " & SPACE_CHAR$ & (Colour1&) & NEWLINE$ PRINT #1, PREFIX_CHAR$ & "Color 2: " & SPACE_CHAR$ & (Colour2&) & NEWLINE$ PRINT #1, PREFIX_CHAR$ & "Color 3: " & SPACE_CHAR$ & (Colour3&) & NEWLINE$ PRINT #1, PREFIX_CHAR$ & "Color 4: " & SPACE_CHAR$ & (Colour4&) & NEWLINE$ IF ECOverprint = -1 THEN 'temp fix for Booleans; replace -1 with TRUE when fixed PRINT #1, PREFIX_CHAR$ & "Overprint: " & SPACE_CHAR$ & "ON" & NEWLINE$ ELSE PRINT #1, PREFIX_CHAR$ & "Overprint: " & SPACE_CHAR$ & "OFF" & NEWLINE$ ENDIF END WITHOBJECT END SUB ' ************************************************************************************** ' GetParaAlignmentInfo ' This subroutine obtains the paragraph alignment attributes for the active paragraph tag ' ************************************************************************************** SUB GetParaAlignmentInfo DIM FrameWideText As BOOLEAN DIM AddPrev AS BOOLEAN WITHOBJECT OBJECT_VENTURA8 .FormatParaAlignmentGet Hor&, Vert&, FrameWideText, RPFromLeft&, RPFromRight&, LPFromLeft&, LPFromRight&, LinesToIndent&, FirstLinesIndent&, AddPrev, DecFromRight&, DecimalChar&, AbsoluteYPosition& PRINT #1, DIALOG_PREFIX$ & "Paragraph Properties : Alignment" & NEWLINE$ SELECT CASE Hor& CASE 0 : PRINT #1, PREFIX_CHAR$ & "Horizontal: " & SPACE_CHAR$ & "Left" & NEWLINE$ CASE 1 : PRINT #1, PREFIX_CHAR$ & "Horizontal: " & SPACE_CHAR$ & "Center" & NEWLINE$ CASE 2 : PRINT #1, PREFIX_CHAR$ & "Horizontal: " & SPACE_CHAR$ & "Right" & NEWLINE$ CASE 3 : PRINT #1, PREFIX_CHAR$ & "Horizontal: " & SPACE_CHAR$ & "Decimal" & NEWLINE$ CASE 4 : PRINT #1, PREFIX_CHAR$ & "Horizontal: " & SPACE_CHAR$ & "Justified" & NEWLINE$ CASE 5 : PRINT #1, PREFIX_CHAR$ & "Horizontal: " & SPACE_CHAR$ & "Force justified" & NEWLINE$ CASE ELSE : PRINT #1, PREFIX_CHAR$ & "Horizontal: " & SPACE_CHAR$ & "Unknown" & NEWLINE$ END SELECT SELECT CASE Vert& CASE 0 : PRINT #1, PREFIX_CHAR$ & "Vertical: " & SPACE_CHAR$ & "Top" & NEWLINE$ CASE 1 : PRINT #1, PREFIX_CHAR$ & "Vertical: " & SPACE_CHAR$ & "Middle" & NEWLINE$ CASE 2 : PRINT #1, PREFIX_CHAR$ & "Vertical: " & SPACE_CHAR$ & "Bottom" & NEWLINE$ CASE 3 : PRINT #1, PREFIX_CHAR$ & "Vertical: " & SPACE_CHAR$ & "Absolute" & NEWLINE$ CASE ELSE : PRINT #1, PREFIX_CHAR$ & "Vertical: " & SPACE_CHAR$ & "Unknown" & NEWLINE$ END SELECT REM IF FrameWideText = -1 THEN 'temp fix for Booleans; replace -1 with TRUE when fixed REM PRINT #1, PREFIX_CHAR$ & "Frame Wide Text: " & SPACE_CHAR$ & "ON" & NEWLINE$ REM ELSE REM PRINT #1, PREFIX_CHAR$ & "Frame Wide Text: " & SPACE_CHAR$ & "OFF" & NEWLINE$ REM ENDIF DBLRPFromLeft# = CDBL(RPFromLeft&) ConvertTo HorizontalUnits&, DBLRPFromLeft# PRINT #1, PREFIX_CHAR$ & "Right Page In From Left: " & SPACE_CHAR$ & DBLRPFromLeft# & UNITS_PREFIX$ & Units$(HorizontalUnits&) & NEWLINE$ DBLRPFromRight# = CDBL(RPFromRight&) ConvertTo HorizontalUnits&, DBLRPFromRight# PRINT #1, PREFIX_CHAR$ & "Right Page In From Right: " & SPACE_CHAR$ & DBLRPFromRight# & UNITS_PREFIX$ & Units$(HorizontalUnits&) & NEWLINE$ DBLLPFromLeft# = CDBL(LPFromLeft&) ConvertTo HorizontalUnits&, DBLLPFromLeft# PRINT #1, PREFIX_CHAR$ & "Left Page In From Left: " & SPACE_CHAR$ & DBLLPFromLeft# & UNITS_PREFIX$ & Units$(HorizontalUnits&) & NEWLINE$ DBLLPFromRight# = CDBL(LPFromRight&) ConvertTo HorizontalUnits&, DBLLPFromRight# PRINT #1, PREFIX_CHAR$ & "Left Page In From Right: " & SPACE_CHAR$ & DBLLPFromRight# & UNITS_PREFIX$ & Units$(HorizontalUnits&) & NEWLINE$ PRINT #1, PREFIX_CHAR$ & "Lines To Indent: " & SPACE_CHAR$ & LinesToIndent& & NEWLINE$ DBLFirstLinesIndent# = CDBL(FirstLinesIndent&) ConvertTo HorizontalUnits&, DBLFirstLinesIndent# PRINT #1, PREFIX_CHAR$ & "Lines Indent Amount: " & SPACE_CHAR$ & DBLFirstLinesIndent# & UNITS_PREFIX$ & Units$(HorizontalUnits&) & NEWLINE$ IF AddPrev = -1 THEN 'temp fix for Booleans; replace -1 with TRUE when fixed PRINT #1, PREFIX_CHAR$ & "Add Width of Preceding Line: " & SPACE_CHAR$ & "ON" & NEWLINE$ ELSE PRINT #1, PREFIX_CHAR$ & "Add Width of Preceding Line: " & SPACE_CHAR$ & "OFF" & NEWLINE$ ENDIF DBLDecFromRight# = CDBL(DecFromRight&) ConvertTo HorizontalUnits&, DBLDecFromRight# PRINT #1, PREFIX_CHAR$ & "Decimal From Right: " & SPACE_CHAR$ & DBLDecFromRight# & UNITS_PREFIX$ & Units$(HorizontalUnits&) & NEWLINE$ PRINT #1, PREFIX_CHAR$ & "Decimal Character: " & SPACE_CHAR$ & (DecimalChar&) & UNITS_PREFIX$ & "ANSI" & NEWLINE$ END WITHOBJECT END SUB ' ************************************************************************************** ' GetParaSpacingInfo ' This subroutine obtains the paragraph spacing attributes for the active paragraph tag ' ************************************************************************************** SUB GetParaSpacingInfo DIM GrowInterline AS BOOLEAN DIM AddAbove AS BOOLEAN DIM AddAboveOnly AS BOOLEAN WITHOBJECT OBJECT_VENTURA8 .FormatParaSpacingGet SpaceAfter&, SpaceBefore&, SpaceInterLine&, SpaceInterPara&, AASpace&, GrowInterline, AddAbove, AddAboveOnly, RotationAngle&, RotationHeight& PRINT #1, DIALOG_PREFIX$ & "Paragraph Properties : Spacing" & NEWLINE$ DBLSpaceAfter# = CDBL(SpaceAfter&) ConvertTo VerticalUnits&, DBLSpaceAfter# PRINT #1, PREFIX_CHAR$ & "Space Above: " & SPACE_CHAR$ & DBLSpaceAfter# & UNITS_PREFIX$ & Units$(VerticalUnits&) & NEWLINE$ DBLSpaceBefore# = CDBL(SpaceBefore&) ConvertTo VerticalUnits&, DBLSpaceBefore# PRINT #1, PREFIX_CHAR$ & "Space Below: " & SPACE_CHAR$ & DBLSpaceBefore# & UNITS_PREFIX$ & Units$(VerticalUnits&) & NEWLINE$ DBLSpaceInterLine# = CDBL(SpaceInterLine&) ConvertTo VerticalUnits&, DBLSpaceInterLine# PRINT #1, PREFIX_CHAR$ & "Inter-line: " & SPACE_CHAR$ & DBLSpaceInterLine# & UNITS_PREFIX$ & Units$(VerticalUnits&) & NEWLINE$ DBLSpaceInterPara# = CDBL(SpaceInterPara&) ConvertTo VerticalUnits&, DBLSpaceInterPara# PRINT #1, PREFIX_CHAR$ & "Inter-paragraph: " & SPACE_CHAR$ & DBLSpaceInterPara# & UNITS_PREFIX$ & Units$(VerticalUnits&) & NEWLINE$ SELECT CASE AASpace& CASE 1 : PRINT #1, PREFIX_CHAR$ & "Auto Adjust: " & SPACE_CHAR$ & "Percentage" & NEWLINE$ CASE 2 : PRINT #1, PREFIX_CHAR$ & "Auto Adjust: " & SPACE_CHAR$ & "Add" & NEWLINE$ CASE 4 : PRINT #1, PREFIX_CHAR$ & "Auto Adjust: " & SPACE_CHAR$ & "None" & NEWLINE$ CASE ELSE : PRINT #1, PREFIX_CHAR$ & "Auto Adjust: " & SPACE_CHAR$ & "Unknown" & NEWLINE$ END SELECT IF GrowInterline = -1 THEN 'temp fix for Booleans; replace -1 with TRUE when fixed PRINT #1, PREFIX_CHAR$ & "Grow Interline: " & SPACE_CHAR$ & "ON" & NEWLINE$ ELSE PRINT #1, PREFIX_CHAR$ & "Grow Interline: " & SPACE_CHAR$ & "OFF" & NEWLINE$ ENDIF IF AddAbove = -1 THEN 'temp fix for Booleans; replace -1 with TRUE when fixed PRINT #1, PREFIX_CHAR$ & "Add Above: " & SPACE_CHAR$ & "ON" & NEWLINE$ ELSE PRINT #1, PREFIX_CHAR$ & "Add Above: " & SPACE_CHAR$ & "OFF" & NEWLINE$ ENDIF IF AddAboveOnly = -1 THEN 'temp fix for Booleans; replace -1 with TRUE when fixed PRINT #1, PREFIX_CHAR$ & "Add Above Space Only: " & SPACE_CHAR$ & "ON" & NEWLINE$ ELSE PRINT #1, PREFIX_CHAR$ & "Add Above Space Only: " & SPACE_CHAR$ & "OFF" & NEWLINE$ ENDIF PRINT #1, PREFIX_CHAR$ & "Rotation Angle: " & SPACE_CHAR$ & (RotationAngle&/10) & UNITS_PREFIX$ & "%" & NEWLINE$ DBLRotationHeight# = CDBL(RotationHeight&) ConvertTo VerticalUnits&, DBLRotationHeight# PRINT #1, PREFIX_CHAR$ & "Max Height: " & SPACE_CHAR$ & DBLRotationHeight# & UNITS_PREFIX$ & Units$(VerticalUnits&) & NEWLINE$ END WITHOBJECT END SUB ' ************************************************************************************** ' GetParaTabInfo ' This subroutine obtains the paragraph alignment attributes for the active paragraph tag ' ************************************************************************************** SUB GetParaTabInfo DIM Leader AS BOOLEAN WITHOBJECT OBJECT_VENTURA8 PRINT #1, DIALOG_PREFIX$ & "Paragraph Properties : Tabs" & NEWLINE$ TabCount& = .FormatParaTabCount() IF SelectedApp& = PUBLISH_TO_VENTURA OR SelectedApp& = PUBLISH_TO_TEXT THEN IF TabCount& > 0 THEN FOR Position& = 1 TO TabCount& .FormatParaTabGetAt Position&, Location!, Align&, Leader, LeaderChar&, LeaderSpacing& DBLLocation# = CDBL(Location!) ConvertTo HorizontalUnits&, FROMINCHES(DBLLocation#) Round DBLLocation#, .010 PRINT #1, PREFIX_CHAR$ & "Tab " & Position& & " Location: " & SPACE_CHAR$ & DBLLocation# & UNITS_PREFIX$ & Units$(HorizontalUnits&) & NEWLINE$ SELECT CASE Align& CASE 0 : PRINT #1, PREFIX_CHAR$ & "Tab " & Position& & " Alignment: " & SPACE_CHAR$ & "Left" & NEWLINE$ CASE 1 : PRINT #1, PREFIX_CHAR$ & "Tab " & Position& & " Alignment: " & SPACE_CHAR$ & "Right" & NEWLINE$ CASE 2 : PRINT #1, PREFIX_CHAR$ & "Tab " & Position& & " Alignment: " & SPACE_CHAR$ & "Decimal" & NEWLINE$ CASE 3 : PRINT #1, PREFIX_CHAR$ & "Tab " & Position& & " Alignment: " & SPACE_CHAR$ & "Center" & NEWLINE$ CASE ELSE : PRINT #1, PREFIX_CHAR$ & "Tab " & Position& & " Alignment: " & SPACE_CHAR$ & "" & NEWLINE$ END SELECT PRINT #1, PREFIX_CHAR$ & "Tab " & Position& & " Leader: " & SPACE_CHAR$ & (Leader) & NEWLINE$ PRINT #1, PREFIX_CHAR$ & "Tab " & Position& & " Leader Character: " & SPACE_CHAR$ & (LeaderChar&) & UNITS_PREFIX$ & "ANSI" & NEWLINE$ PRINT #1, PREFIX_CHAR$ & "Tab " & Position& & " Leader Spacing: " & SPACE_CHAR$ & (LeaderSpacing&) & NEWLINE$ NEXT Position& ELSE Position& = 0 : SETEMPTY Location! : Align&=-1 : SETEMPTY Leader : SETEMPTY LeaderChar& : SETEMPTY LeaderSpacing& PRINT #1, PREFIX_CHAR$ & "No tabs set" & NEWLINE$ ENDIF ELSE IF TabCount& > 0 THEN 'get position parameter for all tabs FOR Position& = 1 TO TabCount& .FormatParaTabGetAt Position&, Location!, Align&, Leader, LeaderChar&, LeaderSpacing& PositionStr$ = PositionStr$ & STR(Position&) & ", " NEXT Position& PositionStr$ = MID(PositionStr$, 1, LEN(PositionStr$)-2) 'get location parameter for all tabs FOR Position& = 1 TO TabCount& .FormatParaTabGetAt Position&, Location!, Align&, Leader, LeaderChar&, LeaderSpacing& DBLLocation# = CDBL(Location!) ConvertTo HorizontalUnits&, FROMINCHES(DBLLocation#) LocationStr$ = LocationStr$ & STR(DBLLocation#) & ", " NEXT Position& LocationStr$ = MID(LocationStr$, 1, LEN(LocationStr$)-2) & UNITS_PREFIX$ & Units$(HorizontalUnits&) 'get alignment parameter for all tabs FOR Position& = 1 TO TabCount& .FormatParaTabGetAt Position&, Location!, Align&, Leader, LeaderChar&, LeaderSpacing& SELECT CASE Align& CASE 0 : Alignment$ = "Left" CASE 1 : Alignment$ = "Right" CASE 2 : Alignment$ = "Decimal" CASE 3 : Alignment$ = "Center" CASE ELSE : Alignment$ = "" END SELECT AlignmentStr$ = AlignmentStr$ & Alignment$ & ", " NEXT Position& AlignmentStr$ = MID(AlignmentStr$, 1, LEN(AlignmentStr$)-2) 'get Leader parameter for all tabs FOR Position& = 1 TO TabCount& .FormatParaTabGetAt Position&, Location!, Align&, Leader, LeaderChar&, LeaderSpacing& REM IF Leader = TRUE THEN REM LeaderStr$ = LeaderStr$ & "ON" & ", " REM ELSE REM LeaderStr$ = LeaderStr$ & "OFF" & ", " REM ENDIF LeaderStr$ = LeaderStr$ & Leader & ", " NEXT Position& LeaderStr$ = MID(LeaderStr$, 1, LEN(LeaderStr$)-2) 'get LeaderChar parameter for all tabs FOR Position& = 1 TO TabCount& .FormatParaTabGetAt Position&, Location!, Align&, Leader, LeaderChar&, LeaderSpacing& LeaderCharStr$ = LeaderCharStr$ & STR(LeaderChar) & ", " NEXT Position& LeaderCharStr$ = MID(LeaderCharStr$, 1, LEN(LeaderCharStr$)-2) & UNITS_PREFIX$ & "ANSI" 'get LeaderSpacing parameter for all tabs FOR Position& = 1 TO TabCount& .FormatParaTabGetAt Position&, Location!, Align&, Leader, LeaderChar&, LeaderSpacing& LeaderSpacingStr$ = LeaderSpacingStr$ & STR(LeaderSpacing&) & ", " NEXT Position& LeaderSpacingStr$ = MID(LeaderSpacingStr$, 1, LEN(LeaderSpacingStr$)-2) ELSE Position& = 0 : SETEMPTY LocationStr$ : SETEMPTY AlignmentStr$ : SETEMPTY LeaderStr$ : SETEMPTY LeaderCharStr$ : SETEMPTY LeaderSpacingStr$ PositionStr$ = "No tabs set" ENDIF PRINT #1, PREFIX_CHAR$ & "Position: " & SPACE_CHAR$ & PositionStr$ & NEWLINE$ PRINT #1, PREFIX_CHAR$ & "Location: " & SPACE_CHAR$ & LocationStr$ & NEWLINE$ PRINT #1, PREFIX_CHAR$ & "Alignment: " & SPACE_CHAR$ & AlignmentStr$ & NEWLINE$ PRINT #1, PREFIX_CHAR$ & "Leader: " & SPACE_CHAR$ & LeaderStr$ & NEWLINE$ PRINT #1, PREFIX_CHAR$ & "Leader Character: " & SPACE_CHAR$ & LeaderCharStr$ & NEWLINE$ PRINT #1, PREFIX_CHAR$ & "Leader Spacing: " & SPACE_CHAR$ & LeaderSpacingStr$ & NEWLINE$ SETEMPTY PositionStr$ : SETEMPTY LocationStr$ : SETEMPTY AlignmentStr$ : SETEMPTY LeaderStr$ : SETEMPTY LeaderCharStr$ : SETEMPTY LeaderSpacingStr$ ENDIF END WITHOBJECT END SUB ' ************************************************************************************** ' GetParaBreaksInfo ' This subroutine obtains the paragraph break attributes for the active paragraph tag ' ************************************************************************************** SUB GetParaBreaksInfo DIM InLineWithPrev AS BOOLEAN DIM AllowBreakWithin AS BOOLEAN DIM KeepWithNext AS BOOLEAN DIM KeepWithPrev AS BOOLEAN DIM FrameWideText As BOOLEAN WITHOBJECT OBJECT_VENTURA8 .FormatParaBreaksGet PageBreak&, ColumnBreak&, LineBreak&, InLineWithPrev, AllowBreakWithin, KeepWithNext, KeepWithPrev PRINT #1, DIALOG_PREFIX$ & "Paragraph Properties : Breaks" & NEWLINE$ SELECT CASE PageBreak& CASE 0 : PRINT #1, PREFIX_CHAR$ & "Page Break: " & SPACE_CHAR$ & "None" & NEWLINE$ CASE 1 : PRINT #1, PREFIX_CHAR$ & "Page Break: " & SPACE_CHAR$ & "Before" & NEWLINE$ CASE 2 : PRINT #1, PREFIX_CHAR$ & "Page Break: " & SPACE_CHAR$ & "After" & NEWLINE$ CASE 3 : PRINT #1, PREFIX_CHAR$ & "Page Break: " & SPACE_CHAR$ & "Before & After" & NEWLINE$ CASE 4 : PRINT #1, PREFIX_CHAR$ & "Page Break: " & SPACE_CHAR$ & "Before/Until Left" & NEWLINE$ CASE 5 : PRINT #1, PREFIX_CHAR$ & "Page Break: " & SPACE_CHAR$ & "Before/Until Right" & NEWLINE$ CASE ELSE : PRINT #1, PREFIX_CHAR$ & "Page Break: " & SPACE_CHAR$ & "Unknown" & NEWLINE$ END SELECT SELECT CASE ColumnBreak& CASE 0 : PRINT #1, PREFIX_CHAR$ & "Column Break: " & SPACE_CHAR$ & "None" & NEWLINE$ CASE 1 : PRINT #1, PREFIX_CHAR$ & "Column Break: " & SPACE_CHAR$ & "Before" & NEWLINE$ CASE 2 : PRINT #1, PREFIX_CHAR$ & "Column Break: " & SPACE_CHAR$ & "After" & NEWLINE$ CASE 3 : PRINT #1, PREFIX_CHAR$ & "Column Break: " & SPACE_CHAR$ & "Before & After" & NEWLINE$ CASE ELSE : PRINT #1, PREFIX_CHAR$ & "Column Break: " & SPACE_CHAR$ & "Unknown" & NEWLINE$ END SELECT SELECT CASE LineBreak& CASE 0 : PRINT #1, PREFIX_CHAR$ & "Line Break: " & SPACE_CHAR$ & "None" & NEWLINE$ CASE 1 : PRINT #1, PREFIX_CHAR$ & "Line Break: " & SPACE_CHAR$ & "Before" & NEWLINE$ CASE 2 : PRINT #1, PREFIX_CHAR$ & "Line Break: " & SPACE_CHAR$ & "After" & NEWLINE$ CASE 3 : PRINT #1, PREFIX_CHAR$ & "Line Break: " & SPACE_CHAR$ & "Before & After" & NEWLINE$ CASE ELSE : PRINT #1, PREFIX_CHAR$ & "Line Break: " & SPACE_CHAR$ & "Unknown" & NEWLINE$ END SELECT IF InLineWithPrev = -1 THEN 'temp fix for Booleans; replace -1 with TRUE when fixed PRINT #1, PREFIX_CHAR$ & "In Line With Previous: " & SPACE_CHAR$ & "ON" & NEWLINE$ ELSE PRINT #1, PREFIX_CHAR$ & "In Line With Previous: " & SPACE_CHAR$ & "OFF" & NEWLINE$ ENDIF IF AllowBreakWithin = -1 THEN 'temp fix for Booleans; replace -1 with TRUE when fixed PRINT #1, PREFIX_CHAR$ & "AllowBreakWithin: " & SPACE_CHAR$ & "ON" & NEWLINE$ ELSE PRINT #1, PREFIX_CHAR$ & "AllowBreakWithin: " & SPACE_CHAR$ & "OFF" & NEWLINE$ ENDIF IF KeepWithNext = -1 THEN 'temp fix for Booleans; replace -1 with TRUE when fixed PRINT #1, PREFIX_CHAR$ & "Keep With Next: " & SPACE_CHAR$ & "ON" & NEWLINE$ ELSE PRINT #1, PREFIX_CHAR$ & "Keep With Next: " & SPACE_CHAR$ & "OFF" & NEWLINE$ ENDIF IF KeepWithPrev = -1 THEN 'temp fix for Booleans; replace -1 with TRUE when fixed PRINT #1, PREFIX_CHAR$ & "Keep With Previous: " & SPACE_CHAR$ & "ON" & NEWLINE$ ELSE PRINT #1, PREFIX_CHAR$ & "Keep With Previous: " & SPACE_CHAR$ & "OFF" & NEWLINE$ ENDIF 'Columns to apan now appears with the Breaks properties .FormatParaDefaultsGet AADefault, ColsToSpan&, NextTag$ ', OverscoreThick&, OverscoreShift&, StrikeThick&, StrikeShift&, ULine1Thick&, ULine1Shift&, ULine2Thick&, ULine2Shift&, SuperscriptPS!, SuperscriptShift&, SubscriptPS!, SubscriptShift&, Tracking&, TrackAmount& PRINT #1, PREFIX_CHAR$ & "Next Tag: " & SPACE_CHAR$ & NextTag$ & NEWLINE$ 'Frame-wide text parameter now appears with the Breaks properties .FormatParaAlignmentGet Hor&, Vert&, FrameWideText ', RPFromLeft&, RPFromRight&, LPFromLeft&, LPFromRight&, LinesToIndent&, FirstLinesIndent&, AddPrev, DecFromRight&, DecimalChar&, AbsoluteYPosition& IF FrameWideText = -1 THEN 'temp fix for Booleans; replace -1 with TRUE when fixed PRINT #1, PREFIX_CHAR$ & "Frame Wide Text: " & SPACE_CHAR$ & "ON" & NEWLINE$ ELSE PRINT #1, PREFIX_CHAR$ & "Frame Wide Text: " & SPACE_CHAR$ & "OFF" & NEWLINE$ ENDIF PRINT #1, PREFIX_CHAR$ & "Columns To Span: " & SPACE_CHAR$ & (ColsToSpan&) & NEWLINE$ END WITHOBJECT END SUB ' ************************************************************************************** ' GetParaHyphenationInfo ' This subroutine obtains the paragraph hyphenation attributes for the active paragraph tag ' ************************************************************************************** SUB GetParaHyphenationInfo DIM Automatic AS BOOLEAN DIM AtPageEnd AS BOOLEAN DIM AtLastWord AS BOOLEAN DIM ForCapital AS BOOLEAN WITHOBJECT OBJECT_VENTURA8 .FormatParaHyphenationGet Automatic, Dict$, SuccessiveHyphs&, MinWordSize&, MinCharsBefore&, MinCharsAfter&, AtPageEnd, AtLastWord, ForCapital PRINT #1, DIALOG_PREFIX$ & "Paragraph Properties : Hyphens" & NEWLINE$ IF Automatic = -1 THEN 'temp fix for Booleans; replace -1 with TRUE when fixed PRINT #1, PREFIX_CHAR$ & "Automatic: " & SPACE_CHAR$ & "ON" & NEWLINE$ ELSE PRINT #1, PREFIX_CHAR$ & "Automatic: " & SPACE_CHAR$ & "OFF" & NEWLINE$ ENDIF PRINT #1, PREFIX_CHAR$ & "Dictionary: " & SPACE_CHAR$ & Dict$ & NEWLINE$ PRINT #1, PREFIX_CHAR$ & "Successive Hyphens: " & SPACE_CHAR$ & (SuccessiveHyphs&) & NEWLINE$ PRINT #1, PREFIX_CHAR$ & "Min Word Size: " & SPACE_CHAR$ & (MinWordSize&) & NEWLINE$ PRINT #1, PREFIX_CHAR$ & "Min Characters Before: " & SPACE_CHAR$ & (MinCharsBefore&) & NEWLINE$ PRINT #1, PREFIX_CHAR$ & "Min Characters After: " & SPACE_CHAR$ & (MinCharsAfter&) & NEWLINE$ IF AtPageEnd = -1 THEN 'temp fix for Booleans; replace -1 with TRUE when fixed PRINT #1, PREFIX_CHAR$ & "At Page End: " & SPACE_CHAR$ & "ON" & NEWLINE$ ELSE PRINT #1, PREFIX_CHAR$ & "At Page End: " & SPACE_CHAR$ & "OFF" & NEWLINE$ ENDIF IF AtLastWord = -1 THEN 'temp fix for Booleans; replace -1 with TRUE when fixed PRINT #1, PREFIX_CHAR$ & "At Last Word: " & SPACE_CHAR$ & "ON" & NEWLINE$ ELSE PRINT #1, PREFIX_CHAR$ & "At Last Word: " & SPACE_CHAR$ & "OFF" & NEWLINE$ ENDIF IF ForCapital = -1 THEN 'temp fix for Booleans; replace -1 with TRUE when fixed PRINT #1, PREFIX_CHAR$ & "For Capitalized: " & SPACE_CHAR$ & "ON" & NEWLINE$ ELSE PRINT #1, PREFIX_CHAR$ & "For Capitalized: " & SPACE_CHAR$ & "OFF" & NEWLINE$ ENDIF END WITHOBJECT END SUB ' ************************************************************************************** ' GetParaTypographyInfo ' This subroutine obtains the paragraph Typography attributes for the active paragraph tag ' ************************************************************************************** SUB GetParaTypographyInfo DIM LetterSpace AS BOOLEAN DIM Kerning AS BOOLEAN WITHOBJECT OBJECT_VENTURA8 .FormatParaTypographyGet WordSpace&, MinWordSpace&, MaxWordSpace&, LetterSpace, MaxLetterSpace&, VJAbove&, VJBelow&, VJInterline&, Kerning PRINT #1, DIALOG_PREFIX$ & "Paragraph Properties : Typography" & NEWLINE$ PRINT #1, PREFIX_CHAR$ & "Word Space: " & SPACE_CHAR$ & (WordSpace&/10) & UNITS_PREFIX$ & "%" & NEWLINE$ PRINT #1, PREFIX_CHAR$ & "Min Word Space: " & SPACE_CHAR$ & (MinWordSpace&/10) & UNITS_PREFIX$ & "%" & NEWLINE$ PRINT #1, PREFIX_CHAR$ & "Max Word Space: " & SPACE_CHAR$ & (MaxWordSpace&/10) & UNITS_PREFIX$ & "%" & NEWLINE$ IF LetterSpace = -1 THEN 'temp fix for Booleans; replace -1 with TRUE when fixed PRINT #1, PREFIX_CHAR$ & "Letter Space: " & SPACE_CHAR$ & "ON" & NEWLINE$ ELSE PRINT #1, PREFIX_CHAR$ & "Letter Space: " & SPACE_CHAR$ & "OFF" & NEWLINE$ ENDIF PRINT #1, PREFIX_CHAR$ & "Max Letter Space: " & SPACE_CHAR$ & (MaxLetterSpace&/10) & UNITS_PREFIX$ & "%" & NEWLINE$ DBLVJAbove# = CDBL(VJAbove&) ConvertTo VerticalUnits&, DBLVJAbove# PRINT #1, PREFIX_CHAR$ & "VJ Above: " & SPACE_CHAR$ & DBLVJAbove# & UNITS_PREFIX$ & Units$(VerticalUnits&) & NEWLINE$ DBLVJBelow# = CDBL(VJBelow&) ConvertTo VerticalUnits&, DBLVJBelow# PRINT #1, PREFIX_CHAR$ & "VJ Below: " & SPACE_CHAR$ & DBLVJBelow# & UNITS_PREFIX$ & Units$(VerticalUnits&) & NEWLINE$ DBLVJInterline# = CDBL(VJInterline&) ConvertTo VerticalUnits&, DBLVJInterline# PRINT #1, PREFIX_CHAR$ & "VJ Interline: " & SPACE_CHAR$ & DBLVJInterline# & UNITS_PREFIX$ & Units$(VerticalUnits&) & NEWLINE$ IF Kerning = -1 THEN 'temp fix for Booleans; replace -1 with TRUE when fixed PRINT #1, PREFIX_CHAR$ & "Kerning: " & SPACE_CHAR$ & "ON" & NEWLINE$ ELSE PRINT #1, PREFIX_CHAR$ & "Kerning: " & SPACE_CHAR$ & "OFF" & NEWLINE$ ENDIF END WITHOBJECT END SUB ' ************************************************************************************** ' GetParaDefaultsInfo ' This subroutine obtains the paragraph default attributes for the active paragraph tag ' ************************************************************************************** SUB GetParaDefaultsInfo DIM AADefault AS BOOLEAN WITHOBJECT OBJECT_VENTURA8 .FormatParaDefaultsGet AADefault, ColsToSpan&, NextTag$, OverscoreThick&, OverscoreShift&, StrikeThick&, StrikeShift&, ULine1Thick&, ULine1Shift&, ULine2Thick&, ULine2Shift&, SuperscriptPS!, SuperscriptShift&, SubscriptPS!, SubscriptShift&, Tracking&, TrackAmount& PRINT #1, DIALOG_PREFIX$ & "Paragraph Properties : Defaults" & NEWLINE$ IF AADefault = -1 THEN 'temp fix for Booleans; replace -1 with TRUE when fixed PRINT #1, PREFIX_CHAR$ & "Auto Adjust: " & SPACE_CHAR$ & "ON" & NEWLINE$ ELSE PRINT #1, PREFIX_CHAR$ & "Auto Adjust: " & SPACE_CHAR$ & "OFF" & NEWLINE$ ENDIF REM PRINT #1, PREFIX_CHAR$ & "Columns To Span: " & SPACE_CHAR$ & (ColsToSpan&) & NEWLINE$ REM PRINT #1, PREFIX_CHAR$ & "Next Tag: " & SPACE_CHAR$ & NextTag$ & NEWLINE$ DBLOverscoreThick# = CDBL(OverscoreThick&) ConvertTo UnderlineUnits&, DBLOverscoreThick# PRINT #1, PREFIX_CHAR$ & "Overscore Thickness: " & SPACE_CHAR$ & DBLOverscoreThick# & UNITS_PREFIX$ & Units$(UnderlineUnits&) & NEWLINE$ DBLOverscoreShift# = CDBL(OverscoreShift&) ConvertTo UnderlineUnits&, DBLOverscoreShift# PRINT #1, PREFIX_CHAR$ & "Overscore Shift: " & SPACE_CHAR$ & DBLOverscoreShift# & UNITS_PREFIX$ & Units$(UnderlineUnits&) & NEWLINE$ DBLStrikeThick# = CDBL(StrikeThick&) ConvertTo UnderlineUnits&, DBLStrikeThick# PRINT #1, PREFIX_CHAR$ & "Strike Thickness: " & SPACE_CHAR$ & DBLStrikeThick# & UNITS_PREFIX$ & Units$(UnderlineUnits&) & NEWLINE$ DBLStrikeShift# = CDBL(StrikeShift&) ConvertTo UnderlineUnits&, DBLStrikeShift# PRINT #1, PREFIX_CHAR$ & "Strike Shift: " & SPACE_CHAR$ & DBLStrikeShift# & UNITS_PREFIX$ & Units$(UnderlineUnits&) & NEWLINE$ DBLULine1Thick# = CDBL(ULine1Thick&) ConvertTo UnderlineUnits&, DBLULine1Thick# PRINT #1, PREFIX_CHAR$ & "UnderLine1 Thickness: " & SPACE_CHAR$ & DBLULine1Thick# & UNITS_PREFIX$ & Units$(UnderlineUnits&) & NEWLINE$ DBLULine1Shift# = CDBL(ULine1Shift&) ConvertTo UnderlineUnits&, DBLULine1Shift# PRINT #1, PREFIX_CHAR$ & "UnderLine1 Shift: " & SPACE_CHAR$ & DBLULine1Shift# & UNITS_PREFIX$ & Units$(UnderlineUnits&) & NEWLINE$ DBLULine2Thick# = CDBL(ULine2Thick&) ConvertTo UnderlineUnits&, DBLULine2Thick# PRINT #1, PREFIX_CHAR$ & "UnderLine2 Thickness: " & SPACE_CHAR$ & DBLULine2Thick# & UNITS_PREFIX$ & Units$(UnderlineUnits&) & NEWLINE$ DBLULine2Shift# = CDBL(ULine2Shift&) ConvertTo UnderlineUnits&, DBLULine2Shift# PRINT #1, PREFIX_CHAR$ & "UnderLine2 Shift: " & SPACE_CHAR$ & DBLULine2Shift# & UNITS_PREFIX$ & Units$(UnderlineUnits&) & NEWLINE$ DBLSuperscriptPS# = CDBL(SuperscriptPS!) ConvertTo UnderlineUnits&, FROMPOINTS(DBLSuperscriptPS#) Round DBLSuperscriptPS#, .010 PRINT #1, PREFIX_CHAR$ & "Superscript Point Size: " & SPACE_CHAR$ & DBLSuperscriptPS# & UNITS_PREFIX$ & Units$(UnderlineUnits&) & NEWLINE$ DBLSuperscriptShift# = CDBL(SuperscriptShift&) ConvertTo UnderlineUnits&, DBLSuperscriptShift# PRINT #1, PREFIX_CHAR$ & "Superscript Shift: " & SPACE_CHAR$ & DBLSuperscriptShift# & UNITS_PREFIX$ & Units$(UnderlineUnits&) & NEWLINE$ DBLSubscriptPS# = CDBL(SubscriptPS!) ConvertTo UnderlineUnits&, FROMPOINTS(DBLSubscriptPS#) Round DBLSubscriptPS#, .010 PRINT #1, PREFIX_CHAR$ & "Subscript Point Size: " & SPACE_CHAR$ & DBLSubscriptPS# & UNITS_PREFIX$ & Units$(UnderlineUnits&) & NEWLINE$ DBLSubscriptShift# = CDBL(SubscriptShift&) ConvertTo UnderlineUnits&, DBLSubscriptShift# PRINT #1, PREFIX_CHAR$ & "Subscript Shift: " & SPACE_CHAR$ & DBLSubscriptShift# & UNITS_PREFIX$ & Units$(UnderlineUnits&) & NEWLINE$ SELECT CASE Tracking& CASE 0 : PRINT #1, PREFIX_CHAR$ & "Tracking type: " & SPACE_CHAR$ & "Very loose" & NEWLINE$ CASE 1 : PRINT #1, PREFIX_CHAR$ & "Tracking type: " & SPACE_CHAR$ & "Looser" & NEWLINE$ CASE 2 : PRINT #1, PREFIX_CHAR$ & "Tracking type: " & SPACE_CHAR$ & "Normal" & NEWLINE$ CASE 3 : PRINT #1, PREFIX_CHAR$ & "Tracking type: " & SPACE_CHAR$ & "Tighter" & NEWLINE$ CASE 4 : PRINT #1, PREFIX_CHAR$ & "Tracking type: " & SPACE_CHAR$ & "Very tight" & NEWLINE$ CASE 5 : PRINT #1, PREFIX_CHAR$ & "Tracking type: " & SPACE_CHAR$ & "Custom" & NEWLINE$ CASE ELSE : PRINT #1, PREFIX_CHAR$ & "Tracking type: " & SPACE_CHAR$ & "Unknown" & NEWLINE$ END SELECT PRINT #1, PREFIX_CHAR$ & "Tracking amount: " & SPACE_CHAR$ & (TrackAmount&/10) & UNITS_PREFIX$ & "%" & NEWLINE$ .FormatParaTagEnd END WITHOBJECT END SUB '///////////////////////////////////////////////////////////////////////////////////////////////////////////// ' This subroutine will round off the specified number (Value) ' to the number of decimal places specified by precision SUB Round(Value#, Precision#) Fixed# = FIX(Value) FractValue# = (Value# - Fixed#) * (1/Precision#) FractFixed# = INT(FractValue) FractDelta# = FractValue# - FractFixed# IF FractDelta# >= 0.50 THEN FractFixed# = FractFixed# + 1.0 ENDIF Value# = FIX(Value#) + (FractFixed# * Precision#) END SUB '///////////////////////////////////////////////////////////////////////////////////////////////////// SUB ConvertTo(Units&, BYREF ConvertData AS DOUBLE) SELECT CASE Units& CASE INCHES ConvertData = ConvertData / 254000 CASE MILLIMETERS ConvertData = ConvertData / 10000 CASE PICAS ConvertData = TOPICAS(ConvertData) CASE POINTS ConvertData = (ConvertData / 254000) * 72 CASE CICEROS ConvertData = TOCICEROS(ConvertData) CASE DIDOTS ConvertData = TODIDOTS(ConvertData) END SELECT Round ConvertData#, .010 END SUB