home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 October A / Pcwk10a98.iso / Corel / Ventura8 / Ventura / Scripts / StyleSheetInformation.csc < prev    next >
Encoding:
Text File  |  1998-07-08  |  129.8 KB  |  2,893 lines

  1. REM Generates style sheet information [CorelSCRIPT 8]
  2. REM StyleSheetInformation.csc  March, 1998
  3. REM ⌐ 1998 Corel Corporation. All rights reserved.
  4.  
  5. REM **********************************************************************
  6. REM This script extracts paragraph tag information for the specified ventura publication. 
  7. REM ParaTag info can be written to any of the following formats:
  8. REM         Corel VENTURA 7
  9. REM         Corel Quattro Pro
  10. REM         Corel SCRIPT
  11. REM         MS Excel
  12. REM         ASCII Text file
  13. REM **********************************************************************
  14.  
  15. #addfol "..\..\Scripts"        ' create a tmporary folder to provide a path for the include files
  16. #include "ScpConst.csi"        ' this enables the include files to be located 
  17. #include "VPConst.csi"        
  18.  
  19. ' Constants for ANSII Char Set
  20. #define QUOTE CHR(34)
  21.  
  22. ' Constants for Dialog Return Values
  23. GLOBAL CONST DIALOG_RETURN_CANCEL% = 2
  24. GLOBAL CONST DIALOG_RETURN_NEXT% = 3
  25. GLOBAL CONST DIALOG_RETURN_BACK% = 4
  26. GLOBAL CONST DIALOG_RETURN_BROWSE% = 5
  27.  
  28. ' Constants for Selected Application
  29. GLOBAL CONST PUBLISH_TO_VENTURA% = 0
  30. GLOBAL CONST PUBLISH_TO_QUATTROPRO% = 1
  31. GLOBAL CONST PUBLISH_TO_SCRIPT% = 2
  32. GLOBAL CONST PUBLISH_TO_EXCEL% = 3 
  33. GLOBAL CONST PUBLISH_TO_TEXT% = 4
  34.  
  35. ' Embed bitmaps if script is to be compiled into exe or csb formats
  36. ' this will eliminate the need to include these files
  37. #ADDRESBMP IntroBMP "Bitmaps\IntroBMP.bmp"
  38. #ADDRESBMP Step2BMP "Bitmaps\Step2BMP.bmp"
  39. #ADDRESBMP Step3BMP "Bitmaps\Step3BMP.bmp"
  40. #ADDRESBMP LastBMP "Bitmaps\LastBMP.bmp"
  41.  
  42. ' Definitions for Ventura units
  43. #DEFINE INCHES 1
  44. #DEFINE MILLIMETERS 2
  45. #DEFINE PICAS 3
  46. #DEFINE POINTS 4
  47. #DEFINE CICEROS 5
  48. #DEFINE DIDOTS 6
  49.  
  50. '/////FUNCTION & SUBROUTINE DECLARATIONS/////////////////////////////////////////////////
  51. ' Windows API functions
  52. DECLARE FUNCTION FindWindow LIB "user32" (BYVAL lpClassName AS STRING, BYVAL lpWindowName AS LONG) AS LONG ALIAS "FindWindowA"
  53. 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" 
  54. ' Dialog functions and subroutines
  55. DECLARE FUNCTION ShowIntro%()
  56. DECLARE FUNCTION GetVentFile%()
  57. DECLARE FUNCTION SelectApp%()
  58. DECLARE FUNCTION GetDestinationFile%()
  59. DECLARE FUNCTION GetUnitInfo%
  60. DECLARE FUNCTION ShowFinish%()
  61. DECLARE SUB ShowSummary()
  62. ' Local functions and subroutines
  63. DECLARE FUNCTION RegQuery(MainKey&, SubKey$, Value$) AS STRING
  64. DECLARE SUB UseVentura()
  65. DECLARE SUB UseScript()
  66. DECLARE SUB UseQP()
  67. DECLARE SUB UseExcel()
  68. DECLARE SUB UseTextFile(TextFile$)
  69. DECLARE SUB GetLine(Variable$)
  70. DECLARE SUB CreateAutoCloseFile()
  71. DECLARE FUNCTION DoesFileExist(FileName$) AS BOOLEAN
  72. DECLARE SUB UpDateQPMacro()
  73. DECLARE SUB ConvertTo(Units&, BYREF ConvertData AS DOUBLE) 
  74. DECLARE SUB Round(Value#, Precision#)
  75. DECLARE SUB Initialize
  76. ' paragraph attribute functions and subroutines
  77. DECLARE SUB GetMasterPageGeneral(MasterPageName$)
  78. DECLARE SUB GetMasterPageMargins(MasterPageName$, PageType AS BOOLEAN)
  79. DECLARE SUB GetMasterPageColumns(MasterPageName$, PageType AS BOOLEAN)
  80. DECLARE SUB GetParaFontInfo
  81. DECLARE SUB GetParaColorInfo(Background AS BOOLEAN)
  82. DECLARE SUB GetParaEffects
  83. DECLARE SUB GetBulletInfo
  84. DECLARE SUB GetDropCapsInfo
  85. DECLARE SUB GetEffectFontInfo
  86. DECLARE SUB GetEffectColorInfo(EffectBackGround AS BOOLEAN)
  87. DECLARE SUB GetParaAlignmentInfo    
  88. DECLARE SUB GetParaSpacingInfo
  89. DECLARE SUB GetParaTabInfo
  90. DECLARE SUB GetParaBreaksInfo
  91. DECLARE SUB GetParaHyphenationInfo
  92. DECLARE SUB GetParaTypographyInfo
  93. DECLARE SUB GetParaDefaultsInfo
  94.  
  95. '/////GLOBAL VARIABLES ////////////////////////////////////////////////////////
  96. GLOBAL VenturaDir$        ' Root directory where Ventura is installed
  97. GLOBAL CloseVal&        ' Variable indicating whether to leave pub open or closed: 0-leave open; 1-close
  98. GLOBAL InputFile$        ' The name of the Ventura publication from which to extract style information
  99. GLOBAL OutputFile$        ' The name of the file in which to output information (file type varies depending on application selected)
  100. GLOBAL SelectedApp&        ' Specifies the application to publish the style information to : 0-Ventura; 1-QuattroPro; 2- Script; 3-Excel; 4-Text file
  101. GLOBAL FileFilter$        ' The file extension of the selected application (used by GETFILEBOX() file extension parameter)
  102. GLOBAL OpenPubs%        ' The number of open Ventura publication
  103. GLOBAL StylesFile$        'REM look into whether we actually need this
  104. CloseVal& = 0
  105. GLOBAL QPFile$            ' The name of the Quattro Pro file
  106. GLOBAL ExcelPath$        ' The path to the Excel executable (Excel.exe)
  107. GLOBAL DialogTitle$        ' The title of the dialog - the name of the active Ventura publication is displayed
  108.  
  109. ' Defines and dimensions the array listing the available unit types
  110. GLOBAL Units$(6)
  111. Units$(1) = "inches"
  112. Units$(2) = "millimeters"
  113. Units$(3) = "picas, points"
  114. Units$(4) = "points"
  115. Units$(5) = "ciceros, didots"
  116. Units$(6) = "didots"
  117.  
  118. ' Defines and initializes the units of measurement to be used for the various settings
  119. GLOBAL FontUnits&        : FontUnits& = 4        'default font units to points
  120. GLOBAL DimensionUnits&    : DimensionUnits& = 1    'default dimension units to inches    
  121. GLOBAL MarginUnits&        : MarginUnits& = 1        'default margin units to inches    
  122. GLOBAL LineUnits&        : LineUnits& = 4         'default line units to points
  123. GLOBAL UnderlineUnits&    : UnderlineUnits& = 4    'default underline units to points
  124. GLOBAL HorizontalUnits&    : HorizontalUnits& = 1    'default horizontal units to inches    
  125. GLOBAL VerticalUnits&    : VerticalUnits& = 4    'default vertical units to points
  126.  
  127. ' Declares variables used for formatting the text file depending on which format the output will be written to
  128. GLOBAL NEWLINE$            ' Specifies the formatting to be used for a new line
  129. GLOBAL TITLE_PREFIX$        ' Specifies the formatting to be used for the title
  130. GLOBAL SECTION_PREFIX$         ' Specifies the formatting to be used for the section heading
  131. GLOBAL DIALOG_PREFIX$        ' Specifies the formatting to be used for the dialog heading
  132. GLOBAL TAG_PREFIX$            ' Specifies the formatting to be used for each tag name
  133. GLOBAL UNITS_PREFIX$        ' Specifies the formatting to be used for the units
  134. GLOBAL PREFIX_CHAR$            ' Specifies the formatting to be used for inserting text at the start of a line
  135. GLOBAL SPACE_CHAR$            ' Specifies the formatting to be used for inserting a space
  136.  
  137.  
  138. ' **************************************************************************************
  139. ' MAIN
  140. ' **************************************************************************************
  141. '///// LOCAL DECLARATIONS ////////////////////////////////////////////////////////////////////////////////////
  142. CONST MAXSTEP% = 6        ' Maximum number of steps in dialog loop (ie. Indicates when to exit dialog loop)
  143. DIM DialogReturn%        ' Variable indicating which button was pressed on the most recent dialog
  144. DIM NextStep%            ' Variable indicating which dialog to activate next
  145. DialogReturn% = 1        ' Initialize dialog counter to start at the first dialog
  146.  
  147. ON ERROR GOTO ErrorHandler
  148.  
  149. 'get root directory where Ventura is installed
  150. VenturaMainKey& = HKEY_LOCAL_MACHINE
  151. VenturaSubKey$ = VENTURA_REGQUERY_CONST
  152. VenturaValue$ = "Destination"
  153. VenturaDir$ = RegQuery(VenturaMainKey&, VenturaSubKey$, VenturaValue$) 
  154.  
  155. InputFile$=VenturaDir$ & "\Ventura\Samples"
  156. OutputFile$=VenturaDir$ & "\Ventura\Samples"
  157.  
  158. ' Dialog loop
  159. DO
  160.     SELECT CASE NextStep%
  161.         CASE 1: DialogReturn% = ShowIntro()            ' Show Intro dialog
  162.         CASE 2: DialogReturn% = GetVentFile()            ' Get input pub
  163.         CASE 3: DialogReturn% = SelectApp()            ' Get output application
  164.         CASE 4: DialogReturn% = GetUnitInfo()            ' Get units to display attributes 
  165.         CASE 5: DialogReturn% = GetDestinationFile()        ' Get output file name
  166.         CASE 6: DialogReturn% = ShowFinish()            ' Show finish dialog
  167.     END SELECT
  168.     NextStep% = NextStep% + DialogReturn%
  169. LOOP UNTIL NextStep% = MAXSTEP + 1
  170.  
  171. Initialize
  172.  
  173. ExitScript:
  174. STOP
  175.  
  176. ErrorHandler:
  177. SELECT CASE ErrNum
  178.     CASE 800
  179.         MESSAGE "FATAL ERROR" & CHR(13) & "Script will now exit."
  180.         RESUME AT ExitScript
  181.     CASE ELSE
  182.         MESSAGE "ERROR: " & STR(ErrNum) & CHR(13) & "Script will now exit."
  183.         RESUME AT ExitScript
  184.     END SELECT
  185.  
  186.  
  187. ' **************************************************************************************
  188. ' RegQuery
  189. ' This subroutine queries the Registry to determine the root directory where Ventura is installed
  190. ' **************************************************************************************
  191. FUNCTION RegQuery(MainKey&, SubKey$, Value$) AS STRING
  192. ON ERROR RESUME NEXT    
  193.     RegQuery = REGISTRYQUERY(MainKey&, SubKey$, Value$)        
  194. END FUNCTION
  195.  
  196. ' **************************************************************************************
  197. ' GetLine
  198. ' This subroutine reads a line of text from the open text file.
  199. '
  200. ' PARAMS: Variable - the string variable holding the line of text read.
  201. '
  202. ' **************************************************************************************
  203. SUB GetLine(Variable$)
  204.     DO
  205.          LINE INPUT #1, Variable$
  206.     LOOP UNTIL LEN(Variable$)>1 OR EOF(1)
  207. END SUB
  208.  
  209.  
  210. ' **************************************************************************************
  211. ' DoesFileExist
  212. ' This function determines whether the specified file exists.
  213. '
  214. ' PARAMS:FileName AS STRING - The name and path of the file in question.
  215. ' RETURNS: DoesFileExist AS BOOLEAN - TRUE if the file exists.
  216. '                                   - FALSE if the file does not exist.
  217. ' **************************************************************************************
  218. FUNCTION DoesFileExist(FileName$) AS BOOLEAN
  219. ON ERROR GOTO ErrorHandler
  220.     FileStatus$ = FINDFIRSTFOLDER(FileName$, FILEATTR_READ_ONLY OR FILEATTR_HIDDEN OR FILEATTR_SYSTEM OR FILEATTR_ARCHIVE OR FILEATTR_NORMAL_FILE OR FILEATTR_TEMPORARY)
  221.     IF FileStatus$ = "" THEN
  222.         DoesFileExist = FALSE
  223.     ELSE
  224.         DoesFileExist = TRUE
  225.     ENDIF
  226.  
  227. FunctionEnd:
  228. EXIT FUNCTION
  229.  
  230. ErrorHandler:
  231.     SELECT CASE ErrNum
  232.         CASE ELSE
  233.             DoesFileExist = FALSE
  234.     END SELECT
  235.     RESUME AT FunctionEnd
  236. END FUNCTION
  237.  
  238.  
  239.  
  240. ' **************************************************************************************
  241. ' Initialize
  242. ' This subroutine initializes Ventura and calls the appropriate subroutine based on user 
  243. ' output selection.
  244. '
  245. ' PARAMS: None
  246. ' **************************************************************************************
  247. SUB Initialize
  248.     WITHOBJECT OBJECT_VENTURA8
  249.         .SetVisible TRUE
  250.         IF OpenPubs% = 0 THEN 
  251.             .FileOpen InputFile$
  252.         ELSE
  253.             CurrentPub$ = .PublicationName()
  254.             IF CurrentPub$ <> InputFile$ THEN 
  255.                 .FileOpen InputFile$
  256.             ENDIF
  257.         ENDIF
  258.     END WITHOBJECT
  259.     
  260.     SELECT CASE SelectedApp&
  261.         CASE PUBLISH_TO_VENTURA
  262.             UseVentura
  263.         CASE PUBLISH_TO_QUATTROPRO
  264.             UseQP
  265.         CASE PUBLISH_TO_SCRIPT
  266.             UseScript
  267.         CASE PUBLISH_TO_EXCEL
  268.             UseExcel
  269.         CASE PUBLISH_TO_TEXT
  270.             TITLE_PREFIX$ = "@Title = "
  271.             SECTION_PREFIX$ = "@Section = Paragraph Tag Settings"
  272.             DIALOG_PREFIX$ = "@Dialog = "
  273.             TAG_PREFIX$ = "@Tag Name = "    
  274.             PREFIX_CHAR$ = CHR(9)
  275.             NEWLINE$ = CHR(13) & CHR(10)
  276.             SPACE_CHAR$ = CHR(9)
  277.             UNITS_PREFIX$ = " "
  278.             UseTextFile(OutputFile$)
  279.             MESSAGE OutputFile$ & CHR(13) & "has been created."
  280.     END SELECT
  281. END SUB
  282.  
  283.  
  284. ' **************************************************************************************
  285. ' ShowIntro
  286. ' This function displays the introduction dialog.
  287. ' PARAMS:None
  288. '
  289. ' RETURNS: ShowIntro AS INTEGER - Integer indicating dialog return value(user selection)
  290. ' **************************************************************************************
  291. FUNCTION ShowIntro%
  292. DIM IntroRet%
  293. BEGIN DIALOG OBJECT IntroDialog 290, 180, "Stylesheet Information Wizard", SUB IntroDialogEventHandler
  294.     PUSHBUTTON  181, 160, 46, 14, .NextButton, "&Next >"
  295.     CANCELBUTTON  234, 160, 46, 14, .CancelButton
  296.     PUSHBUTTON  135, 160, 46, 14, .BackButton, "< &Back"
  297.     TEXT  95, 10, 185, 20, .Text2, "This Wizard generates stylesheet information, including paragraph and page tag information."
  298.     TEXT  95, 60, 185, 18, .Text3, "To begin, click Next."
  299.     IMAGE  10, 10, 75, 130, .IntroImage
  300.     GROUPBOX  10, 150, 270, 5, .LineGroupBox
  301.     TEXT  124, 126, 102, 12, .Text5, "Overrides will not be included."
  302.     TEXT  97, 126, 25, 9, .Text4, "Note:"
  303.     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."
  304. END DIALOG
  305.  
  306. IntroDialog.IntroImage.SetImage "#IntroBMP"
  307. IntroDialog.IntroImage.SetStyle STYLE_CENTERED
  308.  
  309.     IntroRet%=DIALOG(IntroDialog)
  310.     IF IntroRet% = DIALOG_RETURN_CANCEL THEN STOP
  311.  
  312.     IF IntroRet% = DIALOG_RETURN_NEXT THEN         
  313.         WITHOBJECT OBJECT_VENTURA8
  314.             'see if there is an open pub
  315.             OpenPubs% = .CountWindows()
  316.             IF  OpenPubs% <> 0 THEN 
  317.                 IF DoesFileExist(InputFile$)=TRUE THEN 
  318.                     first% = 1
  319.                     pos% = 1
  320.                     DO WHILE first <> 0
  321.                         first% = INSTR(InputFile$, "\", first%)
  322.                         IF first% <> 0 THEN
  323.                             pos% = first%
  324.                             first% = first% + 1
  325.                         END IF
  326.                     LOOP
  327.                     DialogTitle$ = MID(InputFile$, pos%+1) 
  328.                     DialogTitle$ = "Stylesheet Information Wizard - " & DialogTitle$    
  329.                     ShowIntro = 2
  330.                 ELSE
  331.                     InputFile$ = .PublicationName()
  332.                     DialogTitle$ = "Stylesheet Information Wizard" 
  333.                     ShowIntro = 1    
  334.                 ENDIF
  335.             ELSE
  336.                 DialogTitle$ = "Stylesheet Information Wizard" 
  337.                 ShowIntro = 1    
  338.             ENDIF
  339.         END WITHOBJECT
  340.     ENDIF
  341. END FUNCTION
  342.  
  343. ' **************************************************************************************
  344. ' IntroDialogEventHandler
  345. ' This subroutine handles events for the intro dialog.
  346. ' PARAMS: BYVAL ControlID% - Integer indicating the dialog control that is generating a dialog event.
  347. '        BYVAL Event% - Integer indicating the dialog event that has occurred in the dialog box
  348. ' **************************************************************************************
  349. SUB IntroDialogEventHandler(BYVAL ControlID%, BYVAL Event%)
  350.     IF Event% = EVENT_INITIALIZATION THEN         
  351.         IntroDialog.BackButton.Enable FALSE 
  352.     ENDIF
  353.     IF Event% = EVENT_MOUSE_CLICK THEN
  354.         SELECT CASE ControlID%
  355.             CASE IntroDialog.NextButton.GetID()
  356.                 IntroDialog.CloseDialog DIALOG_RETURN_NEXT
  357.             CASE IntroDialog.CancelButton.GetID()
  358.                 IntroDialog.CloseDialog DIALOG_RETURN_CANCEL
  359.         END SELECT
  360.     ENDIF
  361. END FUNCTION
  362.  
  363.  
  364. ' **************************************************************************************
  365. ' GetVentFile
  366. ' This function prompts the user for the name of the Ventura pub from which to obtain
  367. ' para tag information.
  368. ' Also prompts user whether to close pub when finished.
  369. ' PARAMS:
  370. '
  371. ' RETURNS: GetVentFile AS INTEGER - Integer indicating dialog return value(user selection)
  372. '
  373. ' **************************************************************************************
  374. FUNCTION GetVentFile%
  375. BEGIN DIALOG OBJECT GetVentFileDialog 290, 180, DialogTitle$, SUB GetVentFileDialogEventHandler
  376.     TEXTBOX  100, 36, 175, 13, .VentFileTextBox
  377.     PUSHBUTTON  227, 57, 46, 14, .BrowseButton, "B&rowse..."
  378.     CHECKBOX  100, 87, 140, 12, .CloseValCheckBox, "&Close publication when finished"
  379.     PUSHBUTTON  135, 160, 46, 14, .BackButton, "< &Back"
  380.     PUSHBUTTON  181, 160, 46, 14, .NextButton, "&Next >"
  381.     CANCELBUTTON  234, 160, 46, 14, .CancelButton
  382.     GROUPBOX  94, 28, 185, 55, .GroupBox1
  383.     IMAGE  10, 10, 75, 130, .VentFileImage
  384.     GROUPBOX  10, 150, 270, 5, .LineGroupBox
  385.     TEXT  95, 10, 185, 20, .Text2, "From which Corel VENTURA Publication would you like to extract paragraph tag information?"
  386.     TEXT  95, 130, 185, 12, .Text3, "Testing"
  387. END DIALOG
  388.  
  389. GetVentFileDialog.VentFileImage.SetImage "#Step2BMP"
  390. GetVentFileDialog.VentFileImage.SetStyle STYLE_CENTERED
  391. GetVentFileDialog.VentFileTextBox.SetText InputFile$
  392. GetVentFileDialog.CloseValCheckBox.SetValue CloseVal&
  393. GetVentFileDialog.CloseValCheckBox.SetThreeState FALSE
  394. GetVentFileDialog.Text3.SetStyle STYLE_SUNKEN
  395. GetVentFileDialog.SetStyle STYLE_INVISIBLE
  396.  
  397.     GetVentFileRet%=DIALOG(GetVentFileDialog)
  398.     SELECT CASE GetVentFileRet%
  399.         CASE DIALOG_RETURN_CANCEL        
  400.              STOP
  401.         CASE DIALOG_RETURN_NEXT         
  402.             GetVentFile = 1
  403.         CASE DIALOG_RETURN_BACK         
  404.             GetVentFile = -1
  405.     END SELECT
  406. END FUNCTION
  407.  
  408.  
  409. ' **************************************************************************************
  410. ' GetVentFileDialogEventHandler
  411. ' This subroutine handles events for the Ventura file dialog.
  412. ' PARAMS: BYVAL ControlID% - Integer indicating the dialog control that is generating a dialog event.
  413. '        BYVAL Event% - Integer indicating the dialog event that has occurred in the dialog box
  414. ' **************************************************************************************
  415. SUB GetVentFileDialogEventHandler(BYVAL ControlID%, BYVAL Event%)
  416.     IF Event% = EVENT_INITIALIZATION THEN         
  417.         GetVentFileDialog.SetStyle STYLE_VISIBLE
  418.         InputFile$ = GetVentFileDialog.VentFileTextBox.GetText()
  419.         IF DoesFileExist(InputFile$)=TRUE THEN 
  420.             GetVentFileDialog.NextButton.Enable TRUE
  421.             GetVentFileDialog.Text3.SetText ""
  422.             GetVentFileDialog.Text3.SetStyle STYLE_INVISIBLE
  423.         ELSE
  424.             GetVentFileDialog.NextButton.Enable FALSE
  425.             GetVentFileDialog.Text3.SetText "You need to save your file or specify a file that exists."
  426.             GetVentFileDialog.Text3.SetStyle STYLE_VISIBLE
  427.         ENDIF    
  428.     ENDIF
  429.     IF Event% = EVENT_CHANGE_IN_CONTENT THEN         
  430.         SELECT CASE ControlID%
  431.             CASE GetVentFileDialog.VentFileTextBox.GetID()    
  432.                 InputFile$ = GetVentFileDialog.VentFileTextBox.GetText()
  433.         END SELECT
  434.     ENDIF
  435.  
  436.     IF Event% = EVENT_MOUSE_CLICK THEN         
  437.         SELECT CASE ControlID%
  438.             CASE GetVentFileDialog.NextButton.GetID()        
  439.                 GetVentFileDialog.closedialog DIALOG_RETURN_NEXT
  440.             CASE GetVentFileDialog.BackButton.GetID()        
  441.                 GetVentFileDialog.closedialog DIALOG_RETURN_BACK
  442.             CASE GetVentFileDialog.CancelButton.GetID()        
  443.                 GetVentFileDialog.closedialog DIALOG_RETURN_CANCEL
  444.             CASE GetVentFileDialog.BrowseButton.GetID()        
  445.                 InFile$ = GETFILEBOX("*.vp*|*.vp*", , , , "*.vp*", VenturaDir$ & "\Ventura\Samples")
  446.                 IF InFile$ <> "" THEN InputFile$ = InFile$
  447.                 GetVentFileDialog.VentFileTextBox.SetText InputFile$
  448.                 first% = 1
  449.                 pos% = 1
  450.                 DO WHILE first <> 0
  451.                     first% = INSTR(InputFile$, "\", first%)
  452.                     IF first% <> 0 THEN
  453.                         pos% = first%
  454.                         first% = first% + 1
  455.                     END IF
  456.                 LOOP
  457.                 DialogTitle$ = MID(InputFile$, pos%+1) 
  458.                 DialogTitle$ = "Style Information Wizard - " & DialogTitle$    
  459.                 GetVentFileDialog.SetText DialogTitle$
  460.             CASE GetVentFileDialog.CloseValCheckBox.GetID()        
  461.                 CloseVal& = GetVentFileDialog.CloseValCheckBox.GetValue()
  462.         END SELECT
  463.     ENDIF
  464.  
  465.     InputFile$ = GetVentFileDialog.VentFileTextBox.GetText()
  466.     IF DoesFileExist(InputFile$)=TRUE THEN 
  467.         GetVentFileDialog.NextButton.Enable TRUE
  468.         GetVentFileDialog.Text3.SetText ""
  469.         GetVentFileDialog.Text3.SetStyle STYLE_INVISIBLE
  470.     ELSE
  471.         GetVentFileDialog.NextButton.Enable FALSE
  472.         GetVentFileDialog.Text3.SetText "You need to save your file or specify a file that exists."
  473.         GetVentFileDialog.Text3.SetStyle STYLE_VISIBLE
  474.     ENDIF    
  475. END SUB
  476.  
  477.  
  478.  
  479. ' **************************************************************************************
  480. ' SelectApp
  481. ' This function prompts the user to choose Ventura or Excel.
  482. ' PARAMS:
  483. '
  484. ' RETURNS: SelectApp AS INTEGER - Integer indicating dialog return value(user selection)
  485. ' **************************************************************************************
  486. FUNCTION SelectApp%
  487.  
  488. BEGIN DIALOG OBJECT SelectAppDialog 290, 180, DialogTitle$, SUB SelectAppDialogEventHandler
  489.     OPTIONGROUP .SelectedAppOption
  490.         OPTIONBUTTON  130, 35, 130, 12, .VenturaOption, "Corel &VENTURA"
  491.         OPTIONBUTTON  130, 50, 130, 12, .QuattroProOption, "Corel &Quattro Pro"
  492.         OPTIONBUTTON  130, 65, 130, 12, .ScriptOption, "Corel &SCRIPT"
  493.         OPTIONBUTTON  130, 80, 130, 12, .ExcelOption, "E&xcel"
  494.         OPTIONBUTTON  130, 95, 130, 12, .TextOption, "&Text File"
  495.     PUSHBUTTON  135, 160, 46, 14, .BackButton, "< &Back"
  496.     PUSHBUTTON  181, 160, 46, 14, .NextButton, "&Next >"
  497.     CANCELBUTTON  234, 160, 46, 14, .CancelButton
  498.     TEXT  95, 10, 185, 20, .Text1, "To which format would you like the paragraph tag information extracted?"
  499.     GROUPBOX  95, 25, 185, 90, .GroupBox1, ""
  500.     IMAGE  10, 10, 75, 130, .SelectAppImage
  501.     GROUPBOX  10, 150, 270, 5, .LineGroupBox
  502.     TEXT  95, 120, 185, 20, .StatusText, ""
  503. END DIALOG
  504.  
  505.     SelectAppDialog.SelectAppImage.SetImage "#Step2BMP"
  506.     SelectAppDialog.SelectAppImage.SetStyle STYLE_CENTERED
  507.     SelectAppDialog.StatusText.SetStyle STYLE_SUNKEN
  508.     SelectAppDialog.SetStyle STYLE_INVISIBLE
  509.  
  510.     SelectAppRet%=DIALOG(SelectAppDialog)
  511.     IF SelectAppRet% = DIALOG_RETURN_CANCEL THEN STOP
  512.     IF SelectAppRet% = DIALOG_RETURN_NEXT THEN         
  513.         SelectedApp& = SelectAppDialog.SelectedAppOption.GetValue()
  514.         OutputFile$ = ""
  515.         IF SelectedApp& = PUBLISH_TO_SCRIPT THEN
  516.             SelectApp=2
  517.         ELSE
  518.             SelectApp=1
  519.         ENDIF
  520.     ENDIF
  521.     IF SelectAppRet% = DIALOG_RETURN_BACK THEN 
  522.         IF  OpenPubs% = 0 THEN 
  523.             SelectApp = -1    
  524.         ELSE
  525.             SelectApp = -2
  526.         ENDIF
  527.     ENDIF
  528. END FUNCTION
  529.  
  530.  
  531. ' **************************************************************************************
  532. ' SelectAppDialogEventHandler
  533. ' This subroutine handles events for the selec application dialog.
  534. ' PARAMS: BYVAL ControlID% - Integer indicating the dialog control that is generating a dialog event.
  535. '        BYVAL Event% - Integer indicating the dialog event that has occurred in the dialog box
  536. ' **************************************************************************************
  537. SUB SelectAppDialogEventHandler(BYVAL ControlID%, BYVAL Event%)
  538. ON ERROR RESUME NEXT
  539.     IF Event% = EVENT_INITIALIZATION THEN         
  540.         SelectAppDialog.SetStyle STYLE_VISIBLE
  541.         SelectedApp& = SelectAppDialog.SelectedAppOption.GetValue()
  542.         SELECT CASE SelectedApp&
  543.             CASE PUBLISH_TO_VENTURA
  544.                 SelectAppDialog.StatusText.SetText "Publishes page and paragraph tag information to a Corel VENTURA publication."
  545.             CASE PUBLISH_TO_QUATTROPRO
  546.                 SelectAppDialog.StatusText.SetText "Publishes paragraph tag information to a QuattroPro spreadsheet."
  547.             CASE PUBLISH_TO_SCRIPT
  548.                 SelectAppDialog.StatusText.SetText "Creates a script that applies paragraph tags to a new publication."
  549.             CASE PUBLISH_TO_EXCEL
  550.                 SelectAppDialog.StatusText.SetText "Publishes paragraph tag information to an Excel spreadsheet."
  551.             CASE PUBLISH_TO_TEXT
  552.                 SelectAppDialog.StatusText.SetText "Publishes page and paragraph tag information to a text file."
  553.  
  554.         END SELECT
  555.     ENDIF
  556.  
  557.     IF Event% = EVENT_MOUSE_CLICK THEN         
  558.         SELECT CASE ControlID%
  559.             CASE SelectAppDialog.NextButton.GetID()        
  560.                 SelectedApp& = SelectAppDialog.SelectedAppOption.GetValue()
  561.                 SELECT CASE SelectedApp&
  562.                     CASE PUBLISH_TO_QUATTROPRO
  563.                         QPMainKey& = HKEY_CLASSES_ROOT
  564.                         QPSubKey$ = "QuattroPro.PerfectScript"
  565.                         WPSubKey$ = "WordPerfect.PerfectScript"
  566.                         QPValue$ = ""
  567.                         IF RegQuery(QPMainKey&, QPSubKey$, QPValue$) = "" OR RegQuery(QPMainKey&, WPSubKey$, QPValue$) = ""THEN
  568.                             MESSAGE "Unable to locate QuattroPro registry information." 
  569.                         ELSE
  570.                             SelectAppDialog.closedialog DIALOG_RETURN_NEXT
  571.                         ENDIF
  572.  
  573.                     CASE PUBLISH_TO_EXCEL
  574.                         ExcelMainKey& = HKEY_LOCAL_MACHINE
  575.                         ExcelSubKey$ = "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\EXCEL.EXE"
  576.                         ExcelValue$ = ""
  577.                         IF RegQuery(ExcelMainKey&, ExcelSubKey$, ExcelValue$) = "" THEN
  578.                             MESSAGE "Unable to locate Excel.exe" 
  579.                         ELSE
  580.                             SelectAppDialog.closedialog DIALOG_RETURN_NEXT
  581.                         ENDIF
  582.                     CASE ELSE
  583.                         SelectAppDialog.closedialog DIALOG_RETURN_NEXT
  584.                 END SELECT
  585.  
  586.             CASE SelectAppDialog.BackButton.GetID()            
  587.                 SelectAppDialog.closedialog DIALOG_RETURN_BACK
  588.             CASE SelectAppDialog.CancelButton.GetID()            
  589.                 SelectAppDialog.closedialog DIALOG_RETURN_CANCEL
  590.             CASE SelectAppDialog.VenturaOption.GetID()
  591.                 SelectAppDialog.StatusText.SetText "Publishes page and paragraph tag information to a Corel VENTURA publication."
  592.             CASE SelectAppDialog.QuattroProOption.GetID()
  593.                 SelectAppDialog.StatusText.SetText "Publishes paragraph tag information to a QuattroPro spreadsheet."
  594.             CASE SelectAppDialog.ScriptOption.GetID()
  595.                 SelectAppDialog.StatusText.SetText "Creates a script that applies paragraph tags to a new publication."
  596.             CASE SelectAppDialog.ExcelOption.GetID()
  597.                 SelectAppDialog.StatusText.SetText "Publishes paragraph tag information to an Excel spreadsheet."
  598.             CASE SelectAppDialog.TextOption.GetID()
  599.                 SelectAppDialog.StatusText.SetText "Publishes page and paragraph tag information to a text file."
  600.         END SELECT
  601.     ENDIF
  602. END SUB
  603.  
  604.  
  605.  
  606. ' **************************************************************************************
  607. ' GetUnitInfo
  608. ' This function prompts the user to select which units to display the settings.
  609. '
  610. ' PARAMS:
  611. '
  612. ' RETURNS: GetUnitInfo AS INTEGER - Integer indicating dialog return value(user selection)
  613. ' **************************************************************************************
  614. FUNCTION GetUnitInfo%
  615.  
  616. BEGIN DIALOG OBJECT GetUnitInfoDialog 290, 180, DialogTitle$, SUB GetUnitInfoDialogEventHandler
  617.     TEXT  95, 32, 65, 12, .Text6, "&Font Size:"
  618.     DDLISTBOX  165, 30, 95, 70, .FontSizeListBox
  619.     TEXT  95, 48, 66, 12, .Text2, "&Dimensions:"
  620.     DDLISTBOX  165, 46, 95, 70, .DimensionListBox
  621.     TEXT  95, 64, 65, 10, .Text3, "&Columns && Margins:"
  622.     DDLISTBOX  165, 62, 95, 70, .MarginsListBox
  623.     TEXT  95, 80, 70, 10, .Text4, "&Lines:"
  624.     DDLISTBOX  165, 78, 95, 70, .LinesListBox
  625.     TEXT  96, 96, 65, 10, .Text5, "&Underlines:"
  626.     DDLISTBOX  165, 94, 95, 70, .UnderlineListBox
  627.     TEXT  96, 112, 65, 10, .Text7, "Hori&zontal Spacing:"
  628.     DDLISTBOX  165, 110, 95, 70, .HorizontalListBox
  629.     TEXT  96, 128, 65, 10, .Text8, "&Vertical Spacing:"
  630.     DDLISTBOX  165, 126, 95, 70, .VerticalListBox
  631.     PUSHBUTTON  135, 160, 46, 14, .BackButton, "< &Back"
  632.     PUSHBUTTON  181, 160, 46, 14, .NextButton, "&Next >"
  633.     CANCELBUTTON  234, 160, 46, 14, .CancelButton
  634.     TEXT  95, 10, 185, 20, .Text1, "Select the unit of measurement you would like to use for the corresponding settings."
  635.     IMAGE  10, 10, 75, 130, .DestinationFileImage
  636.     GROUPBOX  10, 150, 270, 5, .LineGroupBox
  637. END DIALOG
  638.  
  639. GetUnitInfoDialog.SetStyle STYLE_INVISIBLE
  640. GetUnitInfoDialog.DestinationFileImage.SetImage "#Step3BMP"
  641. GetUnitInfoDialog.DestinationFileImage.SetStyle STYLE_CENTERED
  642. GetUnitInfoDialog.FontSizeListBox.SetArray Units$
  643. GetUnitInfoDialog.FontSizeListBox.SetSelect FontUnits&
  644. GetUnitInfoDialog.DimensionListBox.SetArray Units$
  645. GetUnitInfoDialog.DimensionListBox.SetSelect DimensionUnits&
  646. GetUnitInfoDialog.MarginsListBox.SetArray Units$
  647. GetUnitInfoDialog.MarginsListBox.SetSelect MarginUnits&
  648. GetUnitInfoDialog.UnderlineListBox.SetArray Units$
  649. GetUnitInfoDialog.UnderlineListBox.SetSelect UnderlineUnits&
  650. GetUnitInfoDialog.HorizontalListBox.SetArray Units$
  651. GetUnitInfoDialog.HorizontalListBox.SetSelect HorizontalUnits&
  652. GetUnitInfoDialog.VerticalListBox.SetArray Units$
  653. GetUnitInfoDialog.VerticalListBox.SetSelect VerticalUnits&
  654. GetUnitInfoDialog.LinesListBox.SetArray Units$
  655. GetUnitInfoDialog.LinesListBox.SetSelect LineUnits&
  656.  
  657.     GetUnitInfoRet%=DIALOG(GetUnitInfoDialog)
  658.     SELECT CASE GetUnitInfoRet%
  659.         CASE DIALOG_RETURN_CANCEL        
  660.              STOP
  661.         CASE DIALOG_RETURN_NEXT         
  662.             GetUnitInfo = 1
  663.         CASE DIALOG_RETURN_BACK         
  664.             GetUnitInfo = -1
  665.     END SELECT
  666.  
  667. END FUNCTION
  668.  
  669. ' **************************************************************************************
  670. ' UnitInfoDialogEventHandler
  671. ' This subroutine handles events for the destination file dialog.
  672. ' PARAMS: BYVAL ControlID% - Integer indicating the dialog control that is generating a dialog event.
  673. '        BYVAL Event% - Integer indicating the dialog event that has occurred in the dialog box
  674. ' **************************************************************************************
  675. SUB GetUnitInfoDialogEventHandler(BYVAL ControlID%, BYVAL Event%)
  676.  
  677.     IF Event% = EVENT_INITIALIZATION THEN         
  678.         GetUnitInfoDialog.SetStyle STYLE_VISIBLE
  679.     ENDIF
  680.  
  681.     IF Event% = EVENT_MOUSE_CLICK THEN         
  682.         SELECT CASE ControlID%
  683.             CASE GetUnitInfoDialog.NextButton.GetID()            
  684.                 GetUnitInfoDialog.closedialog DIALOG_RETURN_NEXT
  685.             CASE GetUnitInfoDialog.BackButton.GetID()            
  686.                 GetUnitInfoDialog.closedialog DIALOG_RETURN_BACK
  687.             CASE GetUnitInfoDialog.CancelButton.GetID()            
  688.                 GetUnitInfoDialog.closedialog DIALOG_RETURN_CANCEL
  689.             CASE GetUnitInfoDialog.FontSizeListBox.GetID()            
  690.                 FontUnits& = GetUnitInfoDialog.FontSizeListBox.GetSelect()
  691.             CASE GetUnitInfoDialog.UnderlineListBox.GetID()            
  692.                 UnderlineUnits& = GetUnitInfoDialog.UnderlineListBox.GetSelect()
  693.             CASE GetUnitInfoDialog.HorizontalListBox.GetID()            
  694.                 HorizontalUnits& = GetUnitInfoDialog.HorizontalListBox.GetSelect()
  695.             CASE GetUnitInfoDialog.VerticalListBox.GetID()            
  696.                 VerticalUnits& = GetUnitInfoDialog.VerticalListBox.GetSelect()
  697.             CASE GetUnitInfoDialog.DimensionListBox.GetID()            
  698.                 DimensionUnits& = GetUnitInfoDialog.DimensionListBox.GetSelect()
  699.             CASE GetUnitInfoDialog.LinesListBox.GetID()            
  700.                 LineUnits& = GetUnitInfoDialog.LinesListBox.GetSelect()
  701.         END SELECT
  702.     ENDIF
  703. END SUB
  704.  
  705.  
  706. ' **************************************************************************************
  707. ' GetDestinationFile
  708. ' This function prompts the user for the name of the destination file to write the para tag 
  709. ' information to.
  710. '
  711. ' PARAMS:
  712. '
  713. ' RETURNS: GetDestinationFile AS INTEGER - Integer indicating dialog return value(user selection)
  714. ' **************************************************************************************
  715. FUNCTION GetDestinationFile%
  716.  
  717. BEGIN DIALOG OBJECT GetDestinationFileDialog 290, 180, DialogTitle$, SUB GetDestinationFileDialogEventHandler
  718.     TEXTBOX  100, 55, 175, 13, .DestinationFileTextBox
  719.     PUSHBUTTON  228, 75, 46, 14, .BrowseButton, "B&rowse..."
  720.     PUSHBUTTON  135, 160, 46, 14, .BackButton, "< &Back"
  721.     PUSHBUTTON  181, 160, 46, 14, .NextButton, "&Next >"
  722.     CANCELBUTTON  234, 160, 46, 14, .CancelButton
  723.     GROUPBOX  95, 40, 185, 60, .FileGroupBox
  724.     TEXT  95, 10, 185, 20, .Text1, ""
  725.     IMAGE  10, 10, 75, 130, .DestinationFileImage
  726.     GROUPBOX  10, 150, 270, 5, .LineGroupBox
  727. END DIALOG
  728.  
  729. GetDestinationFileDialog.SetStyle STYLE_INVISIBLE
  730. GetDestinationFileDialog.DestinationFileImage.SetImage "#Step3BMP"
  731. GetDestinationFileDialog.DestinationFileImage.SetStyle STYLE_CENTERED
  732.  
  733.     GetDestinationFileRet%=DIALOG(GetDestinationFileDialog)
  734.     SELECT CASE GetDestinationFileRet%
  735.         CASE DIALOG_RETURN_CANCEL        
  736.              STOP
  737.         CASE DIALOG_RETURN_NEXT         
  738.             GetDestinationFile = 1
  739.         CASE DIALOG_RETURN_BACK         
  740.             IF SelectedApp& = PUBLISH_TO_SCRIPT THEN
  741.                 GetDestinationFile = -2
  742.             ELSE
  743.                 GetDestinationFile = -1
  744.             ENDIF
  745.     END SELECT
  746. END FUNCTION
  747.  
  748. ' **************************************************************************************
  749. ' GetDestinationFileDialogEventHandler
  750. ' This subroutine handles events for the destination file dialog.
  751. ' PARAMS: BYVAL ControlID% - Integer indicating the dialog control that is generating a dialog event.
  752. '        BYVAL Event% - Integer indicating the dialog event that has occurred in the dialog box
  753. ' **************************************************************************************
  754. SUB GetDestinationFileDialogEventHandler(BYVAL ControlID%, BYVAL Event%)
  755. STATIC FileBoxType%
  756. STATIC DefFile$ 
  757. STATIC DefExt$ 
  758. STATIC DefFolder$
  759.     IF Event% = EVENT_INITIALIZATION THEN         
  760.         GetDestinationFileDialog.SetStyle STYLE_VISIBLE
  761.         IF INSTR(OutputFile$, ".") = 0 THEN
  762.             first% = 1
  763.             pos% = 1
  764.             WHILE first% <> 0
  765.                 first% = INSTR(InputFile$, ".", first%)
  766.                     IF first% <> 0 THEN
  767.                           pos% = first%
  768.                           first% = first% + 1
  769.                     ENDIF
  770.             WEND
  771.             StylesFile$ = MID(InputFile$, 1, pos% - 1)
  772.             SELECT CASE SelectedApp&
  773.                 CASE PUBLISH_TO_VENTURA
  774. REM                     GetDestinationFileDialog.SetText DialogTitle$
  775.                     GetDestinationFileDialog.FileGroupBox.SetText "Publication Files (*.VP*):"
  776.                     GetDestinationFileDialog.Text1.SetText "What would you like to call the new Corel VENTURA publication?"
  777.                     FileFilter$ = "*.vp*|*.vp"
  778.                     FileBoxType% = 1
  779.                     DefFile$ = StylesFile$ & "Styles.VP"
  780.                     DefExt$ = ".vp"
  781.     
  782.                 CASE PUBLISH_TO_QUATTROPRO
  783. REM                     GetDestinationFileDialog.SetText "Style Information Wizard"
  784.                     GetDestinationFileDialog.FileGroupBox.SetText "Quattro Pro Spreadsheet (*.wb3):"
  785.                     GetDestinationFileDialog.Text1.SetText "What would you like to call the Quattro Pro spreadsheet?"
  786.                     FileFilter$ = "*.wb3|*.wb3"
  787.                     FileBoxType% = 0
  788.                     DefFile$ = StylesFile$ & "Styles.wb3"
  789.                     DefExt$ = ".wb3"
  790.                 CASE PUBLISH_TO_SCRIPT
  791. REM                     GetDestinationFileDialog.SetText "Style Information Wizard"
  792.                     GetDestinationFileDialog.FileGroupBox.SetText "Corel SCRIPT file (*.CSC):"
  793.                     GetDestinationFileDialog.Text1.SetText "What would you like to call the script?."
  794.                     FileFilter$ = "*.csc|*.csc"
  795.                     FileBoxType% = 1
  796.                     DefFile$ = StylesFile$ & "Styles.csc"
  797.                     DefExt$ = ".csc"
  798.     
  799.                 CASE PUBLISH_TO_EXCEL
  800. REM                     GetDestinationFileDialog.SetText "Style Information Wizard"
  801.                     GetDestinationFileDialog.FileGroupBox.SetText "MS Excel Spreadsheet (*.XLS):"
  802.                     GetDestinationFileDialog.Text1.SetText "What would you like to call the Excel spreadsheet?"
  803.                     FileFilter$ = "*.xls|*.xls"
  804.                     FileBoxType% = 0
  805.                     DefFile$ = StylesFile$ & "Styles.xls"
  806.                     DefExt$ = ".xls"
  807.     
  808.                 CASE PUBLISH_TO_TEXT
  809. REM                     GetDestinationFileDialog.SetText "Style Information Wizard"
  810.                     GetDestinationFileDialog.FileGroupBox.SetText "Text File (*.TXT):"
  811.                     GetDestinationFileDialog.Text1.SetText "What would you like to call the text file?"
  812.                     FileFilter$ = "*.txt|*.txt"
  813.                     FileBoxType% = 1
  814.                     DefFile$ = StylesFile$ & "Styles.txt"
  815.                     DefExt$ = ".txt"
  816.             END SELECT
  817.             OutputFile$ = DefFolder$ & DefFile$
  818.             GetDestinationFileDialog.DestinationFileTextBox.SetText OutputFile$
  819.         ENDIF
  820.     ENDIF
  821.  
  822.     IF Event% = EVENT_CHANGE_IN_CONTENT THEN         
  823.         SELECT CASE ControlID%
  824.             CASE GetDestinationFileDialog.DestinationFileTextBox.GetID()            '
  825.                 OutputFile$ = GetDestinationFileDialog.DestinationFileTextBox.GetText()
  826.         END SELECT
  827.     ENDIF
  828.  
  829.     IF Event% = EVENT_MOUSE_CLICK THEN         
  830.         SELECT CASE ControlID%
  831.             CASE GetDestinationFileDialog.NextButton.GetID()            
  832.                 OutputFile$ = GetDestinationFileDialog.DestinationFileTextBox.GetText()
  833.                 GetDestinationFileDialog.closedialog DIALOG_RETURN_NEXT
  834.             CASE GetDestinationFileDialog.BackButton.GetID()            
  835.                 GetDestinationFileDialog.closedialog DIALOG_RETURN_BACK
  836.             CASE GetDestinationFileDialog.CancelButton.GetID()            
  837.                 GetDestinationFileDialog.closedialog DIALOG_RETURN_CANCEL
  838.             CASE GetDestinationFileDialog.BrowseButton.GetID()            
  839.                 OutFile$ = GETFILEBOX(FileFilter$, , FileBoxType%, DefFile$, DefExt$, DefFolder$)
  840.                 IF OutFile$ <> "" THEN OutputFile$ = OutFile$
  841.                 GetDestinationFileDialog.DestinationFileTextBox.SetText OutputFile$
  842.         END SELECT
  843.     ENDIF
  844.  
  845.     OutputFile$ = GetDestinationFileDialog.DestinationFileTextBox.GetText()
  846.     IF OutputFile$ = "" OR INSTR(OutputFile$, ".") = 0 THEN 
  847.         GetDestinationFileDialog.NextButton.Enable FALSE
  848.     ELSE
  849.         GetDestinationFileDialog.NextButton.Enable TRUE
  850.     ENDIF    
  851. END SUB
  852.  
  853.  
  854.  
  855. ' **************************************************************************************
  856. ' ShowFinish
  857. ' This function displays the finish dialog verifying the files the user has selected.
  858. ' PARAMS: None
  859. '
  860. ' RETURNS: ShowFinish AS INTEGER - Integer indicating dialog return value(user selection)
  861. ' **************************************************************************************
  862. FUNCTION ShowFinish%
  863. BEGIN DIALOG OBJECT FinishDialog 290, 180, DialogTitle$, SUB FinishDialogEventHandler
  864.     PUSHBUTTON  181, 160, 46, 14, .FinishButton, "&Finish"
  865.     PUSHBUTTON  135, 160, 46, 14, .BackButton, "< &Back"
  866.     CANCELBUTTON  234, 160, 46, 14, .CancelButton
  867.     TEXT  95, 10, 185, 28, .FinishText, FinishText$
  868.     TEXT  95, 125, 185, 12, .Text2, "Click Finish to complete the process."
  869.     IMAGE  10, 10, 75, 130, .FinishImage
  870.     GROUPBOX  10, 150, 270, 5, .LineGroupBox
  871.     TEXT  95, 43, 182, 28, .Text3, FinishText2$
  872.     TEXT  95, 105, 185, 20, .Text4, "This may take a few minutes. Please be patient. You will be notified when the process is complete."
  873. END DIALOG
  874.  
  875.     FinishDialog.SetStyle STYLE_INVISIBLE
  876.     FinishDialog.FinishImage.SetImage "#LastBMP"
  877.     FinishDialog.FinishImage.SetStyle STYLE_CENTERED
  878.     FinishRet%=DIALOG(FinishDialog)        
  879.     IF FinishRet% = DIALOG_RETURN_CANCEL THEN STOP
  880.  
  881.     IF FinishRet% = DIALOG_RETURN_NEXT THEN 
  882.         ShowFinish = 1         
  883.     ENDIF
  884.     IF FinishRet% = DIALOG_RETURN_BACK THEN ShowFinish = -1        
  885. END FUNCTION
  886.  
  887.  
  888. ' **************************************************************************************
  889. ' FinishDialogEventHandler
  890. ' This subroutine handles events for the finish dialog.
  891. ' PARAMS: BYVAL ControlID% - Integer indicating the dialog control that is generating a dialog event.
  892. '        BYVAL Event% - Integer indicating the dialog event that has occurred in the dialog box
  893. ' **************************************************************************************
  894. SUB FinishDialogEventHandler(BYVAL ControlID%, BYVAL Event%)
  895.     IF Event% = EVENT_INITIALIZATION THEN         
  896.         FinishDialog.SetStyle STYLE_VISIBLE
  897.         SELECT CASE SelectedApp&
  898.             CASE PUBLISH_TO_VENTURA
  899.                 FinishText$ = "The Stylesheet Information Wizard is ready to publish your stylesheet information to Corel VENTURA."
  900.             CASE PUBLISH_TO_QUATTROPRO
  901.                 FinishText$ = "The Stylesheet Information Wizard is ready to publish your paragraph tag information to QuattroPro."
  902.                 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."
  903.             CASE PUBLISH_TO_SCRIPT
  904.                 FinishText$ = "The Stylesheet Information Wizard is ready to publish your paragraph tag information to Corel SCRIPT."
  905.                 FinishText2$ = "You will be able to execute the script and create a new publication with the extracted style information."
  906.             CASE PUBLISH_TO_EXCEL
  907.                 FinishText$ = "The Stylesheet Information Wizard is ready to publish your paragraph tag information to Excel."
  908.                 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."
  909.             CASE PUBLISH_TO_TEXT
  910.                 FinishText$ = "The Stylesheet Information Wizard is ready to publish your paragraph tag information to a Text File."
  911.         END SELECT
  912.         FinishDialog.FinishText.SetText FinishText$
  913.         FinishDialog.Text3.SetText FinishText2$
  914.     ENDIF
  915.  
  916.     IF Event% = EVENT_MOUSE_CLICK THEN         
  917.         SELECT CASE ControlID%
  918.             CASE FinishDialog.FinishButton.GetID()            
  919.                 FinishDialog.closedialog DIALOG_RETURN_NEXT
  920.             CASE FinishDialog.BackButton.GetID()        
  921.                 FinishDialog.closedialog DIALOG_RETURN_BACK
  922.             CASE FinishDialog.CancelButton.GetID()        
  923.                 FinishDialog.closedialog DIALOG_RETURN_CANCEL
  924.         END SELECT
  925.     ENDIF
  926. END SUB
  927.  
  928.  
  929. ' **************************************************************************************
  930. ' UseVentura
  931. ' This subroutine publishes style info to a new Ventura publication.
  932. '
  933. ' PARAMS: None
  934. ' **************************************************************************************
  935. SUB UseVentura
  936.     'write para tag info to temporary text file
  937.     TempTextDir$ = GETTEMPFOLDER()
  938.     TempTextFile$ = TempTextDir$ & "TempTextFile.txt"
  939.  
  940.     NEWLINE$ = CHR(13) & CHR(10)
  941.     TITLE_PREFIX$ = "@Minor Heading = "
  942.     SECTION_PREFIX$ = "@Main Heading = Paragraph Tag Settings"
  943.     DIALOG_PREFIX$ = "@Subheading = "
  944.     TAG_PREFIX$ = "@Minor Heading = " & "Tag Name = "    
  945.     SPACE_CHAR$ = CHR(9)
  946.     PREFIX_CHAR$ = "@Bullet = "
  947.     UNITS_PREFIX$ = " "
  948.     BEGINWAITCURSOR
  949.     UseTextFile(TempTextFile$)
  950.     ENDWAITCURSOR
  951.  
  952.     BEGINWAITCURSOR
  953.     WITHOBJECT OBJECT_VENTURA8
  954.         .FileNew
  955.         .FrameFirst TRUE
  956.         .FileImportText TempTextFile$, , 1
  957.         .PageFirstLine
  958.         .FormatParaTagBegin "Bullet"
  959.         .FormatParaTabSet 2.50
  960.         .FormatParaTagEnd
  961.         .FileSaveAs OutputFile$
  962.     END WITHOBJECT
  963.     ENDWAITCURSOR
  964.  
  965.     KILL TempTextFile$
  966. END SUB
  967.  
  968.  
  969. ' **************************************************************************************
  970. ' UseScript 
  971. ' This subroutine creates a script to apply para tag styles to a new pub
  972. '
  973. ' PARAMS:None
  974. ' **************************************************************************************
  975. SUB UseScript
  976. DIM Orientation AS BOOLEAN
  977. DIM GutterRuleOverprint AS BOOLEAN
  978. ScriptFile$ = OutputFile$
  979.  
  980.     BEGINWAITCURSOR
  981.     WITHOBJECT OBJECT_VENTURA8
  982.         OPEN ScriptFile$ FOR OUTPUT AS 2
  983.     
  984.         WithObjString$ = "WITHOBJECT " & QUOTE & OBJECT_VENTURA8 & QUOTE 
  985.         PRINT #2, WithObjString$ 
  986.         PRINT #2, CHR(13)
  987.     
  988.         PRINT #2, ".SetVisible TRUE"    
  989.         PRINT #2, ".FileNew"
  990.         PRINT #2, ".PageFirstLine"
  991.         PRINT #2, CHR(13) 
  992.     
  993.         'delete default tags
  994.         PRINT #2, ".ParaTagDelete " &  QUOTE & "Bullet" & QUOTE
  995.         PRINT #2, ".ParaTagDelete " &  QUOTE & "Heading" & QUOTE
  996.         PRINT #2, ".ParaTagDelete " &  QUOTE & "Main Heading" & QUOTE
  997.         PRINT #2, ".ParaTagDelete " &  QUOTE & "Subheading" & QUOTE
  998.         PRINT #2, ".ParaTagDelete " &  QUOTE & "Minor Heading" & QUOTE
  999.         PRINT #2, ".ParaTagDelete " &  QUOTE & "Numbered List" & QUOTE
  1000.         PRINT #2, ".ParaTagDelete " &  QUOTE & "Z_SEC1" & QUOTE
  1001.         PRINT #2, ".ParaTagDelete " &  QUOTE & "Z_SEC2" & QUOTE
  1002.         PRINT #2, CHR(13) 
  1003.  
  1004.         'MASTER PAGE INFORMATION
  1005.         .ViewMasterPage
  1006.         PRINT #2, ".ViewMasterPage"
  1007.         MPCount& = .MasterPageCount()
  1008.         FOR i% = 1 TO MPCount&
  1009.             CurrentMP$ = .MasterPageGetAt(i%)
  1010.             IF UCASE(CurrentMP$) <> UCASE("Default Master") THEN
  1011.                 PRINT #2, ".MasterPageAddNew " & QUOTE & CurrentMP$ & QUOTE
  1012.             ENDIF            
  1013.  
  1014.             'get general properties for each master page
  1015.             .FormatMasterPageGet Orientation, PaperType&, MPWidth&, MPHeight&, CurrentMP$
  1016.             MasterPageStr$ = ".FormatMasterPage " & Orientation & ", " & PaperType& & ", " & MPWidth& & ", " & MPHeight& & ", " & QUOTE & CurrentMP$ & QUOTE
  1017.             PRINT #2, MasterPageStr$
  1018.  
  1019.             'get margin settings for LEFT Master page
  1020.             .ViewGotoMasterPage CurrentMP$, FALSE, 4
  1021.              .FormatFrameMarginsInsideGet 1, LeftMarg&, RightMarg&, TopMarg&, BottomMarg&
  1022.             PRINT #2, ".ViewGotoMasterPage " & QUOTE & CurrentMP$ & QUOTE & ", FALSE, 4"
  1023.             PRINT #2, ".FormatFrameMarginsInside 1, " & LeftMarg& & ", " & RightMarg& & ", " & TopMarg&  & ", " & BottomMarg&
  1024.  
  1025.             'get column settings for LEFT Master page
  1026. REM             .ViewGotoMasterPage CurrentMP$, FALSE, 4
  1027.              .FormatFrameColumnsGet 1, Columns&, FlowInColumns&, ColumnBalance&, GutterRuleOverprint
  1028.             PRINT #2, ".FormatFrameColumns 1, " & Columns& & ", " & FlowInColumns& & ", " & ColumnBalance&  & ", " & GutterRuleOverprint
  1029.  
  1030.             'get margin settings for RIGHT Master page
  1031.             .ViewGotoMasterPage CurrentMP$, TRUE, 4
  1032.              .FormatFrameMarginsInsideGet 2, LeftMarg&, RightMarg&, TopMarg&, BottomMarg&
  1033.             PRINT #2, ".ViewGotoMasterPage " & QUOTE & CurrentMP$ & QUOTE & ", TRUE, 4"
  1034.             PRINT #2, ".FormatFrameMarginsInside 2, " & LeftMarg& & ", " & RightMarg& & ", " & TopMarg&  & ", " & BottomMarg&
  1035.  
  1036.             'get Column settings for RIGHT Master page
  1037. REM             .ViewGotoMasterPage CurrentMP$, TRUE, 4
  1038.              .FormatFrameColumnsGet 2, Columns&, FlowInColumns&, ColumnBalance&, GutterRuleOverprint
  1039.             PRINT #2, ".FormatFrameColumns 2, " & Columns& & ", " & FlowInColumns& & ", " & ColumnBalance&  & ", " & GutterRuleOverprint
  1040.             PRINT #2, CHR(13) 
  1041.         NEXT i%
  1042.  
  1043.         PRINT #2, ".ViewPageLayout" 
  1044.         PRINT #2, CHR(13) 
  1045.  
  1046.         'PARAGRAPH TAG INFORMATION
  1047.         .ViewPageLayout
  1048.         NumTags%=.ParaTagCount()
  1049.         FOR i%=1 TO NumTags%
  1050.             NameOfTag$=.ParaTagGetAt(i%)
  1051.             IF NameOfTag$ = "" THEN GOTO AllDone
  1052.             .FormatParaTagBegin NameOfTag$
  1053.         
  1054.             PRINT #2, "REM " & NameOfTag$
  1055.             NameOfTag$ = QUOTE & LTRIM(NameOfTag$) & QUOTE
  1056.         
  1057.             bt% = INSTR(NameOfTag$, "Body Text")    'Don't make new tag for body text
  1058.             IF bt%=0 THEN PRINT #2, ".ParaTagAddNew " & NameOfTag$
  1059.             PRINT #2, ".FormatParaTagBegin " & NameOfTag$
  1060.         
  1061.             'ALIGNMENT/////////////////////////////////////////////////////////////////////////////////////////////////
  1062.             DIM FrameWideText As BOOLEAN            
  1063.             DIM AddPrev AS BOOLEAN                
  1064.             .FormatParaAlignmentGet Hor&, Vert&, FrameWideText, RPFromLeft&, RPFromRight&, LPFromLeft&, LPFromRight&, LinesToIndent&, FirstLinesIndent&, AddPrev, DecFromRight&, DecimalChar&, AbsoluteYPosition&
  1065.             AlignmentStr1$ = ".FormatParaAlignment " & (Hor) & ", " & (Vert) & ", " & (FrameWideText) & ", " & (RPFromLeft) & ", " & (RPFromRight) & ", "
  1066.             AlignmentStr2$ =  (LPFromLeft) & ", " & (LPFromRight) & ", " & (LinesToIndent) & ", " & (FirstLinesIndent) & ", " & (AddPrev) & ", " & (DecFromRight) & ", " & (DecimalChar) & ", " & (AbsoluteYPosition) 
  1067.             AlignmentStr$ = AlignmentStr1$ & AlignmentStr2$
  1068.             PRINT #2, AlignmentStr$
  1069.         
  1070.             'BREAKS /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1071.             DIM InLineWithPrev AS BOOLEAN            
  1072.             DIM AllowBreakWithin AS BOOLEAN
  1073.             DIM KeepWithNext AS BOOLEAN
  1074.             DIM KeepWithPrev AS BOOLEAN
  1075.             .FormatParaBreaksGet PageBreak&, ColumnBreak&, LineBreak&, InLineWithPrev, AllowBreakWithin, KeepWithNext, KeepWithPrev
  1076.             BreaksStr$ = ".FormatParaBreaks " &  (PageBreak) & ", " & (ColumnBreak) & ", " & (LineBreak) & ", " & (InLineWithPrev) & ", " & (AllowBreakWithin) & ", " & (KeepWithNext) & ", " & (KeepWithPrev)
  1077.             PRINT #2, BreaksStr$
  1078.         
  1079.             'BULLETS///////////////////////////////////////////////////////////////////////////////////////////////////
  1080.             DIM IndentFirstLineOnly AS BOOLEAN
  1081.             .FormatParaBulletGet Indent&, BulletChar&, ShiftUpDef&, IndentFirstLineOnly
  1082.             BulletStr$ =  ".FormatParaBullet " & (Indent) & ", " & (BulletChar) & ", " & (ShiftUpDef) & ", " & (IndentFirstLineOnly)
  1083.             PRINT #2, BulletStr$
  1084.         
  1085.             'COLOUR////////////////////////////////////////////////////////////////////////////////////////////////////////
  1086.             DIM Background AS BOOLEAN
  1087.             DIM COverprint AS BOOLEAN
  1088.             DIM ColumnWide AS BOOLEAN
  1089.             .FormatParaColorGet BackGround, ColorModel&, Colour1&, Colour2&, Colour3&, Colour4&, COverprint, ColumnWide
  1090.             ColorStr$ = ".FormatParaColor " &  (BackGround) & ", " & (ColorModel) & ", " & (Colour1) & ", " & (Colour2) & ", " & (Colour3) & ", " & (Colour4) & ", " & (COverprint)& ", " & (ColumnWide)
  1091.             PRINT #2, ColorStr$
  1092.         
  1093.             'DEFAULTS////////////////////////////////////////////////////////////////////////////////////////////////////////
  1094.             DIM AADefault AS BOOLEAN
  1095.             .FormatParaDefaultsGet AADefault, ColsToSpan&, NextTag$, OverscoreThick&, OverscoreShift&, StrikeThick&, StrikeShift&, ULine1Thick&, ULine1Shift&, ULine2Thick&, ULine2Shift&, SuperscriptPS!, SuperscriptShift&, SubscriptPS!, SubscriptShift&
  1096.             IF NextTag$ <> "" THEN NextTag$ = QUOTE & NextTag$ & QUOTE
  1097.             DefaultStr1$ = ".FormatParaDefaults " & (AADefault) & ", " & (ColsToSpan&) & ", " & NextTag$ & ", " & (OverscoreThick&) & ", "
  1098.             DefaultStr2$ =  (OverscoreShift&) & ", " & (StrikeThick&) & ", " & (StrikeShift&) & ", " & (ULine1Thick&) & ", " & (ULine1Shift&) & ", "
  1099.             DefaultStr3$ =     (ULine2Thick&) & ", " & (ULine2Shift&) & ", " & (SuperscriptPS!) & ", " & (SuperscriptShift&) & ", " & (SubscriptPS!) & ", " & (SubscriptShift&)
  1100.          
  1101.             DefaultStr$ = DefaultStr1$ & DefaultStr2$ & DefaultStr3$
  1102.             PRINT #2, DefaultStr$
  1103.         
  1104.             'DROPCAPS////////////////////////////////////////////////////////////////////////////////////////////////////////
  1105.             .FormatParaDropCapGet CharCount&, ShiftUpDropCap&, CustomLineCount&
  1106.             DropCapsStr$ = ".FormatParaDropCap " & (CharCount) & ", " & (ShiftUpDropCap) & ", " & (CustomLineCount)
  1107.             PRINT #2, DropCapsStr$
  1108.         
  1109.             'EFFECT FONT////////////////////////////////////////////////////////////////////////////////////////////////////
  1110.             DIM bEffectStrike AS BOOLEAN
  1111.             DIM bEffectOverscore AS BOOLEAN
  1112.             DIM bEffectItalic AS BOOLEAN
  1113.             .FormatParaEffectFontGet EffectFontName$, EffectPointSize!, EffectWeight&, bEffectItalic, EffectUnderline&, bEffectStrike, bEffectOverscore
  1114.         
  1115.             IF EffectFontName$ <> "" THEN EffectFontName$ = QUOTE & EffectFontName$ & QUOTE
  1116.             EffectFontStr$ = ".FormatParaEffectFont " &  EffectFontName & ", " & (EffectPointSize) & ", " & (EffectWeight) & ", " & (bEffectItalic)& ", " & (EffectUnderline) & ", " & (bEffectStrike) & ", " & (bEffectOverscore)
  1117.             PRINT #2, EffectFontStr$
  1118.         
  1119.             'EFFECT COLOUR////////////////////////////////////////////////////////////////////////////////////////////////////////
  1120.             DIM EffectBackground AS BOOLEAN
  1121.             DIM Overprint AS BOOLEAN
  1122.             .FormatParaEffectColorGet EffectBackGround, ColorModel&, Colour1&, Colour2&, Colour3&, Colour4&, Overprint
  1123.             EffectColorStr$ = ".FormatParaEffectColor " &  (EffectBackGround) & ", " & (ColorModel) & ", " & (Colour1) & ", " & (Colour2) & ", " & (Colour3) & ", " & (Colour4) & ", " & (Overprint)
  1124.             PRINT #2, EffectColorStr$
  1125.         
  1126.             'EFFECT////////////////////////////////////////////////////////////////////////////////////////////////////////
  1127.             .FormatParaEffectsGet EffectType&, TextAfter$, TextBefore$
  1128.             IF TextAfter$ <> "" THEN TextAfter$ = QUOTE & TextAfter$ & QUOTE
  1129.             IF TextBefore$ <> "" THEN TextBefore$ = QUOTE & TextBefore$ & QUOTE
  1130.             EffectsStr$ = ".FormatParaEffects " & (EffectType) & ", " & TextAfter$ & ", " & TextBefore$
  1131.             PRINT #2, EffectsStr$
  1132.         
  1133.             'FONT//////////////////////////////////////////////////////////////////////////////////////////////////////////
  1134.             DIM bItalic AS BOOLEAN
  1135.             DIM bStrikeThru AS BOOLEAN
  1136.             DIM bOverscore AS BOOLEAN
  1137.             DIM bUppercase AS BOOLEAN
  1138.             .FormatParaFontGet FontName$, PointSize!, Weight&, bItalic, Underline&, bStrikeThru, bOverscore, bUppercase
  1139.             IF FontName$ <> "" THEN FontName$ = QUOTE & FontName$ & QUOTE
  1140.             FontStr$ = ".FormatParaFont " &  FontName$ & ", " & (PointSize) & ", " & (Weight) & ", " & (bItalic) & ", " & (Underline) & ", " & (bStrikeThru) & ", " & (bOverscore) & ", " & (bUppercase) 
  1141.             PRINT #2, FontStr$
  1142.         
  1143.             'HYPHENATION////////////////////////////////////////////////////////////////////////////////////////////////////////
  1144.             DIM Automatic AS BOOLEAN
  1145.             DIM AtPageEnd AS BOOLEAN
  1146.             DIM AtLastWord AS BOOLEAN
  1147.             DIM ForCapital AS BOOLEAN
  1148.             .FormatParaHyphenationGet Automatic, Dict$, SuccessiveHyphs&, MinWordSize&, MinCharsBefore&, MinCharsAfter&, AtPageEnd, AtLastWord, ForCapital
  1149.             IF Dict$ <> "" THEN Dict$ = QUOTE & Dict$ & QUOTE
  1150.             HyphenationStr1$ = ".FormatParaHyphenation " & (Automatic) & ", " & Dict$ & ", " & (SuccessiveHyphs&) & ", " & (MinWordSize) & ", " & (MinCharsBefore) & ", "
  1151.             HyphenationStr2$ =  (MinCharsAfter) & ", " & (AtPageEnd) & ", " & (AtLastWord) & ", " & (ForCapital)
  1152.             HyphenationStr$ = HyphenationStr1$ & HyphenationStr2$
  1153.             PRINT #2,  HyphenationStr$
  1154.         
  1155.             'SPACING///////////////////////////////////////////////////////////////////////////////////////////////////////////
  1156.             DIM GrowInterline AS BOOLEAN
  1157.             DIM AddAbove AS BOOLEAN
  1158.             DIM AddAboveOnly AS BOOLEAN
  1159.             .FormatParaSpacingGet SpaceAfter&, SpaceBefore&, SpaceInterLine&, SpaceInterPara&, AASpace&, GrowInterline, AddAbove, AddAboveOnly, RotationAngle&, RotationHeight&
  1160.             SpacingStr1$ = ".FormatParaSpacing " & (SpaceAfter) & ", " & (SpaceBefore) & ", " & (SpaceInterLine) & ", " & (SpaceInterPara) & ", " & (AASpace&) & ", "
  1161.             SpacingStr2$ =  (GrowInterline) & ", " & (AddAbove) & ", " & (AddAboveOnly) & ", " & (RotationAngle) & ", " & (RotationHeight)
  1162.             SpacingStr$ = SpacingStr1$ & SpacingStr2$
  1163.             PRINT #2,  SpacingStr$
  1164.         
  1165.             'TAB AT///////////////////////////////////////////////////////////////////////////////////////////////////////////
  1166.             DIM Leader AS BOOLEAN
  1167.             .FormatParaTabGetAt Position&, Location!, Align&, Leader, LeaderChar&, LeaderSpacing&
  1168.             TabSetStr$ = ".FormatParaTabSet " &  (Location) & ", " & (Align) & ", " & (Leader) & ", " & (LeaderChar) & ", " & (LeaderSpacing)
  1169.             PRINT #2, TabSetStr$
  1170.         
  1171.             'TYPOGRAPHY///////////////////////////////////////////////////////////////////////////////////////////////////////////
  1172.             DIM LetterSpace AS BOOLEAN
  1173.             DIM Kerning AS BOOLEAN
  1174.             .FormatParaTypographyGet WordSpace&, MinWordSpace&, MaxWordSpace&, LetterSpace, MaxLetterSpace&, VJAbove&, VJBelow&, VJInterline&, Kerning
  1175.             TypographyStr1$ = ".FormatParaTypography " & (WordSpace) & ", " & (MinWordSpace) & ", " & (MaxWordSpace) & ", " & (LetterSpace) & ", " & (MaxLetterSpace) & ", "
  1176.             TypographyStr2$ =  (VJAbove) & ", " & (VJBelow) & ", " & (VJInterline) & ", " & (Kerning)
  1177.             TypographyStr$ = TypographyStr1$ & TypographyStr2$
  1178.             PRINT #2, TypographyStr$
  1179.         
  1180.             PRINT #2, ".FormatParaTagEnd"
  1181.              PRINT #2, CHR(13)
  1182.         NEXT i%
  1183.     
  1184.         PRINT #2, "END WITHOBJECT"
  1185. AllDone:
  1186.         CLOSE(2)
  1187.     END WITHOBJECT
  1188.     ENDWAITCURSOR
  1189.     MESSAGE ScriptFile$ & CHR(13) & "has been created." 
  1190.  
  1191. END SUB
  1192.  
  1193.  
  1194. ' **************************************************************************************
  1195. ' UseQP
  1196. ' This subroutine publishes style info to a Quattro Pro spreadsheet.
  1197. '
  1198. ' PARAMS: None
  1199. ' **************************************************************************************
  1200. SUB UseQP
  1201.     'write para tag info to temporary text file
  1202.     TempTextDir$ = GETTEMPFOLDER()
  1203.     TempTextFile$ = TempTextDir$ & "TempTextFile.txt"
  1204.     NEWLINE$ = CHR(13)
  1205.     TITLE_PREFIX$ = "@Title = "
  1206.     SECTION_PREFIX$ = "@Section = Paragraph Tag Settings"
  1207.     DIALOG_PREFIX$ = "@Dialog = "
  1208.     TAG_PREFIX$ = "@Tag Name = "    
  1209.     SPACE_CHAR$ = SPACE(8)
  1210.     PREFIX_CHAR$ = SPACE(8)
  1211.     UNITS_PREFIX$ = " *"
  1212.  
  1213.     BEGINWAITCURSOR
  1214.     UseTextFile(TempTextFile$)
  1215.     ENDWAITCURSOR
  1216.  
  1217.     BEGINWAITCURSOR
  1218.     UpdateQPMacro
  1219.     ENDWAITCURSOR
  1220.  
  1221.     'read temporary text file and write para tag info to a QP spreadsheet
  1222.     OPEN TempTextFile$ FOR INPUT AS 1
  1223.     
  1224.     'Get title of publication
  1225.     GetLine VPDir$
  1226.     'Get name of QP workbook
  1227.     GetLine QPName$
  1228.     
  1229.     'Get title of publication
  1230.     GetLine TitleText$
  1231.     pos% = INSTR(TitleText$, "=")
  1232.     lgth% = LEN(TitleText$)
  1233.     TitleText$ = MID(TitleText$, pos% + 2, lgth% - pos%)
  1234.     
  1235.     'Get section name
  1236.     GetLine SectionText$ 
  1237.     pos% = INSTR(SectionText$, "=")
  1238.     SectionText$ = MID(SectionText$, pos%+1)
  1239.     
  1240.     column% = 0
  1241.     row% = 4
  1242.     
  1243.     'Launch QP and create a new spreadsheet with para tag information
  1244.     BEGINWAITCURSOR
  1245.     WITHOBJECT "QuattroPro.PerfectScript"
  1246.         .FileNew
  1247.  
  1248.         .PUT "A:A1..IV999", 1, 0, TitleText$    'column, row
  1249.         .PUT "A:A1..IV999", 1, 1, SectionText$
  1250.         .PUT "A:A1..IV999", 0, 4, "Units"        'first column, fifth row
  1251.         DO
  1252.             GetLine InText$ 
  1253.             'Ignore if a blank line
  1254.             IF InText$ <> "" THEN
  1255.                 'check for tag name or dialog label
  1256.                 apos% = INSTR(InText$, "@")     
  1257.                 IF apos% <> 0 THEN
  1258.                     pos% = INSTR(InText$, "=")
  1259.                 ELSE
  1260.                     pos% = INSTR(InText$, ":")
  1261.                 ENDIF
  1262.                 lgth% = LEN(InText$)
  1263.                 DescText$= MID(InText$, apos%+1, pos% -1)
  1264.                 DescText$= LTRIM(DescText$)
  1265.                 CText$= MID(InText$, pos%+1, lgth%-pos%)
  1266.                 CText$= LTRIM(CText$)
  1267.  
  1268.                 'start a new row for each new tag name
  1269.                 pos% = INSTR(DescText$, "Tag Name =")     
  1270.                 IF pos% <> 0 THEN
  1271.                     column% = 0
  1272.                     row% = row% + 1
  1273.                 ENDIF
  1274.     
  1275.                 'dialog headings
  1276.                 pos% = INSTR(DescText$, "Dialog =")     
  1277.                 IF pos% <> 0 THEN
  1278.                     pos% = INSTR(CText$, ":")
  1279.                     lgth% = LEN(CText$)
  1280.                     DText$= MID(CText$, pos%+1 , lgth%-pos%)
  1281.                     dcolumn% = column%
  1282.                     .PUT "A:A1..IV999", dcolumn%, 2, DText$
  1283.                 ELSE
  1284.                     .PUT "A:A1..IV999", column%, 3, DescText$
  1285.                            pos% = INSTR(CText, " *")           'check for parameter UNITS
  1286.                          IF pos <> 0 THEN
  1287.                              .PUT "A:A1..IV999", column%, row%, MID(CText, 1, pos% - 1)   'parameter values
  1288.                              .PUT "A:A1..IV999", column%, 4, MID(CText, pos% + 2)         'parameter UNITS
  1289.                         ELSE
  1290.                             .PUT "A:A1..IV999", column%, row%, CText$                    'parameter values
  1291.                         ENDIF
  1292.                     column% = column% + 1
  1293.                 ENDIF
  1294.             ENDIF
  1295.         LOOP UNTIL EOF(1)
  1296.     
  1297.         'insert auto close macro to run on exit from file or application
  1298.         ExitScript$ = CHR(123) & "playperfectscript " & QUOTE & QPFile$ & QUOTE & CHR(125)
  1299.         .BlockName_Create "_nbexitmacro", "A:A1..A:A1"
  1300.         .PUT "A:A1..A:A1", 0, 0, ExitScript$
  1301.         .FileSaveAs OutputFile$
  1302.         ENDWAITCURSOR
  1303.         MESSAGE "Listing completed successfully." & CHR(13) & "You will be prompted on close to apply changes to a new Ventura publication."
  1304.     END WITHOBJECT
  1305.     CLOSE    'close text file 
  1306.     KILL TempTextFile$
  1307. END SUB
  1308.  
  1309.  
  1310.  
  1311. ' **************************************************************************************
  1312. ' UpDateQPMacro 
  1313. ' This subroutine creates the PerfectScript macro used by QuattroPro to  extract the 
  1314. ' para tag info from the spreadsheet and bring it back into Ventura
  1315. ' PARAMS:None
  1316. ' **************************************************************************************
  1317. SUB UpDateQPMacro
  1318.     first% = 1
  1319.     pos% = 1
  1320.     WHILE first% <> 0
  1321.         first% = INSTR(OutputFile$, ".", first%)
  1322.             IF first% <> 0 THEN
  1323.                   pos% = first%
  1324.                   first% = first% + 1
  1325.             ENDIF
  1326.     WEND
  1327.     QPFile$ = MID(OutputFile$, 1, pos% - 1)
  1328.     QPFile$ = QPFile$ & ".wcm"
  1329.     KILL QPFile$
  1330.     WAIT FOR 1
  1331.  
  1332.     WITHOBJECT "WordPerfect.PerfectScript"
  1333.         .AppMinimize
  1334.         .FileNew
  1335.         .SingleSmartQuote 1053    '(OpenSingleQuote: 1053)
  1336.         .SingleSmartQuote 1052    '(CloseSingleQuote: 1052)
  1337.         .DoubleSmartQuote 1056
  1338.         .DoubleSmartQuote 1055
  1339.         .Type "RegKey = RegistryOpenKey(LocalMachine!; " & QUOTE & VENTURA_REGQUERY_CONST & QUOTE & ")"
  1340.         .HardReturn
  1341.         .Type "VPDir:=RegistryQueryValue(RegKey; " & QUOTE & "Destination"  & QUOTE & ")"
  1342.         .HardReturn
  1343.         .Type "BMPFile:= VPDir + " & QUOTE & "\Ventura\Scripts\Bitmaps\Step2bmp.bmp" & QUOTE
  1344.         .HardReturn
  1345.         .Type "WBFile := " & QUOTE & OutputFile$ & QUOTE    
  1346.         .HardReturn
  1347.         .HardReturn
  1348.     
  1349.         .Type "//Prompt user to save workbook file"
  1350.         .HardReturn
  1351.         .Type "NewWBFile := FileNameDialog(StyleOptions:SaveAsDialog!; InitialFileName:WBFile)"
  1352.         .HardReturn
  1353.         .Type "IF (NewWBFile != " & QUOTE & QUOTE & ")"  
  1354.         .HardReturn
  1355.         .Type "     WBFile := NewWBFile"
  1356.         .HardReturn
  1357.         .Type "ENDIF"
  1358.         .HardReturn
  1359.         .HardReturn
  1360.     
  1361.         .Type "Yes := 6"
  1362.         .HardReturn
  1363.         .Type "No := 7"
  1364.         .HardReturn
  1365.         .Type "//prompt user to apply hanges to Ventura"
  1366.         .HardReturn
  1367.         .Type "ans = MessageBox(Status:x; Caption:" & QUOTE & "QuattroPro" & QUOTE & "; Message:" & QUOTE & "Would you like to apply changes to VENTURA?" & QUOTE & "; YesNo!|IconQuestion!)"
  1368.         .HardReturn
  1369.         .HardReturn
  1370.         .Type "IF(ans = No)"
  1371.         .HardReturn
  1372.         .Type "    QUIT"
  1373.         .HardReturn
  1374.         .Type "ELSE"
  1375.         .HardReturn
  1376.         .HardReturn
  1377.     
  1378.         .Type "//Get temp text file location"
  1379.         .HardReturn
  1380.         .Type "TempPathLength= 255"
  1381.         .HardReturn
  1382.         .Type "TempPath = STRFILL( 255; " & QUOTE & SPACE(1) & QUOTE & ")"
  1383.         .HardReturn
  1384.         .Type "DLLLoad(WinHand; " & QUOTE & "Kernel32.dll" & QUOTE & " )"
  1385.         .HardReturn
  1386.         .Type "DLLCall( WinHand; " & QUOTE & "GetTempPathA" & QUOTE & "; PathLength; Integer!; {TempPathLength; ADDRESS(TempPath)})"
  1387.         .HardReturn
  1388.         .Type "TempPath =STRTRIM(TempPath; PathLength-1; TrimLeft!)"
  1389.         .HardReturn
  1390.         .Type "DLLFree(WinHand)"
  1391.         .HardReturn
  1392.         .Type "TempTextFile = TempPath + " & QUOTE & "TempTextFile.txt" & QUOTE
  1393.         .HardReturn
  1394.         .HardReturn
  1395.  
  1396.  
  1397.         REM 
  1398.         .Type "WaitMsgInit()"
  1399.         .HardReturn
  1400.         .Type "WaitMsgDisplay ("  & QUOTE & "Reading spreadsheet..." & QUOTE & ")"
  1401.         .HardReturn
  1402.         .Type "//Launch QP and open workbook file"
  1403.         .HardReturn
  1404.         .Type  "APPLICATION (QuattroPro; " & QUOTE & "QuattroPro" & QUOTE & "; Default;" & QUOTE & "US" & QUOTE & ")"
  1405.         .HardReturn
  1406.         .Type  "FILEOPEN(WBFile)"
  1407.         .HardReturn
  1408.         .HardReturn
  1409.         .Type "//Open temp text file for writing from start of file"
  1410.         .HardReturn
  1411.         .Type "TextFile = OPENFILE( TempTextFile; Write!; None!; AnsiText!)"
  1412.         .HardReturn
  1413.         .Type "FILEPOSITION(TextFile; 0; FromBeginning!)"
  1414.         .HardReturn
  1415.         .HardReturn
  1416.  
  1417.         .Type "//Get title of publication and section name and write to file"
  1418.         .HardReturn
  1419.         .Type "SelectBlock (" & QUOTE & "A:A1..IV999" & QUOTE & ")"
  1420.         .HardReturn
  1421.         .Type "c=" & QUOTE & "1" & QUOTE
  1422.         .HardReturn
  1423.         .Type "r=" & QUOTE & "0" & QUOTE
  1424.         .HardReturn
  1425.         .Type "TitleText = GetCellValue(+" & QUOTE & "C(" & QUOTE & "+c+" & QUOTE & ")R(" & QUOTE & "+r+" & QUOTE & ")" & QUOTE & ")"
  1426.         .HardReturn
  1427.         .Type "TitleText = " & QUOTE & "@Title = " & QUOTE & "+ GetCellValue(+" & QUOTE & "C(" & QUOTE & "+c+" & QUOTE & ")R(" & QUOTE & "+r+" & QUOTE & ")" & QUOTE & ")"
  1428.         .HardReturn
  1429.         .Type "r= " & QUOTE & "1" & QUOTE
  1430.         .HardReturn
  1431.         .Type "SectionText = GetCellValue(+" & QUOTE & "C(" & QUOTE & "+c+" & QUOTE & ")R(" & QUOTE & "+r+" & QUOTE & ")" & QUOTE & ")"
  1432.         .HardReturn
  1433.         .Type "SectionText = " & QUOTE & "@Section = " & QUOTE & " +  SectionText"
  1434.         .HardReturn
  1435.         .Type "BlankLine = " & QUOTE & QUOTE 
  1436.         .HardReturn
  1437.         .Type "FILEWRITE(TextFile; " & QUOTE & "QUATTROPRO" & QUOTE & "; NewLine!;)"
  1438.         .HardReturn
  1439.         .Type "FILEWRITE(TextFile; TitleText; NewLine!;)"
  1440.         .HardReturn
  1441.         .Type "FILEWRITE(TextFile; TitleText; NewLine!;)"
  1442.         .HardReturn
  1443.         .Type "FILEWRITE(TextFile; SectionText; NewLine!;)"
  1444.         .HardReturn
  1445.         .Type "FILEWRITE(TextFile; BlankLine; NewLine!;)"
  1446.         .HardReturn
  1447.         .HardReturn
  1448.         .Type "         r := 5"
  1449.         .HardReturn
  1450.         .Type "        //LOOP for every tag"
  1451.         .HardReturn
  1452.         .Type "        REPEAT"
  1453.         .HardReturn
  1454.         .Type "            c := 0"
  1455.         .HardReturn
  1456.         .Type "            TagName = GetCellValue(+" & QUOTE & "C(" & QUOTE & "+c+" & QUOTE & ")R(" & QUOTE & "+r+" & QUOTE & ")" & QUOTE & ")"
  1457.         .HardReturn
  1458.         .Type "            IF (TagName = " & QUOTE & QUOTE & ")"
  1459.         .HardReturn
  1460.         .Type "                FileExit(DoSave?:No!)"
  1461.         .HardReturn
  1462.         .Type "                AppExecute(CommandLine:VPDir + " & QUOTE & "\Ventura\Scripts\NewStyle.exe" & QUOTE & ")"
  1463.         .HardReturn
  1464.         .Type "                RETURN"
  1465.         .HardReturn
  1466.         .Type "            ENDIF"
  1467.         .HardReturn
  1468.         .HardReturn
  1469.     
  1470.         .Type "            TagName := " & QUOTE & "@TagName = "  & QUOTE & " + TagName"
  1471.         .HardReturn
  1472.         .Type "            FILEWRITE(TextFile; BlankLine; NewLine!;)"
  1473.         .HardReturn
  1474.         .Type "            FILEWRITE(TextFile; TagName; NewLine!;)"
  1475.         .HardReturn
  1476.         .Type "            c := 1"
  1477.         .HardReturn
  1478.     
  1479.         .Type "            REPEAT"
  1480.         .HardReturn
  1481.         .Type "                //get dialog label (row 3)"
  1482.         .HardReturn
  1483.         .Type "                DialogLabel := GetCellValue(+" & QUOTE & "C(" & QUOTE & "+c+" & QUOTE & ")R(2)" & QUOTE & ")"
  1484.         .HardReturn
  1485.         .Type "                  IF (DialogLabel != " & QUOTE & QUOTE & ")"
  1486.         .HardReturn
  1487.         .Type "                    DialogLabel := " & QUOTE & "@Dialog = Paragraph Properties : " & QUOTE & " + DialogLabel"
  1488.         .HardReturn
  1489.         .Type "                    FILEWRITE(TextFile; BlankLine; NewLine!;)"
  1490.         .HardReturn
  1491.         .Type "                    FILEWRITE(TextFile; DialogLabel; NewLine!;)"
  1492.         .HardReturn
  1493.         .Type "                ENDIF"
  1494.         .HardReturn
  1495.         .HardReturn
  1496.     
  1497.         .Type "                   AttributeLabel := GetCellValue(+" & QUOTE & "C(" & QUOTE & "+c+" & QUOTE & ")R(3)" & QUOTE & ")"
  1498.         .HardReturn
  1499.         .Type "                 AttributeValue := GetCellValue(+" & QUOTE & "C(" & QUOTE & "+c+" & QUOTE & ")R(" & QUOTE & "+r+" & QUOTE & ")" & QUOTE & ")"
  1500.         .HardReturn
  1501.         .Type "                   AttributeUnit := GetCellValue(+" & QUOTE & "C(" & QUOTE & "+c+" & QUOTE & ")R(4)" & QUOTE & ")"
  1502.         .HardReturn
  1503.  
  1504.         .Type "                IF (AttributeLabel != " & QUOTE & QUOTE & ")"
  1505.         .HardReturn
  1506.         .Type "                    IF (AttributeUnit != " & QUOTE & QUOTE & ")"
  1507.         .HardReturn
  1508.         .Type "                        AttributeString :=  " & QUOTE & "     "  & QUOTE & "+  AttributeLabel + " & QUOTE & ":     " & QUOTE & " + AttributeValue + " & QUOTE & " *" & QUOTE & " + AttributeUnit"
  1509.         .HardReturn
  1510.         .Type "                    ELSE"
  1511.         .HardReturn
  1512.         .Type "                        AttributeString :=  " & QUOTE & "     "  & QUOTE & "+  AttributeLabel + " & QUOTE & ":     " & QUOTE & " + AttributeValue"
  1513.         .HardReturn
  1514.         .Type "                    ENDIF"
  1515.         .HardReturn
  1516.         .Type "                    FILEWRITE(TextFile; AttributeString; NewLine!;)"
  1517.         .HardReturn
  1518.         .Type "                ENDIF"
  1519.         .HardReturn
  1520.         .Type "                c = c + 1"
  1521.         .HardReturn
  1522.         .Type "            UNTIL  (AttributeLabel = " & QUOTE & QUOTE & ")"
  1523.         .HardReturn
  1524.         .Type "            r = r + 1           // go to next row"
  1525.         .HardReturn
  1526.         .Type "        UNTIL  (TagName = " & QUOTE & QUOTE & ")"
  1527.         .HardReturn
  1528.         .Type "    FileClose(DoSave?:No!)"
  1529.         .HardReturn
  1530.         .Type "    CLOSEFILE"
  1531.         .HardReturn
  1532.         .Type "ENDIF"
  1533.         .HardReturn
  1534.         .Type "WaitMsgHide()"
  1535.         .HardReturn
  1536.         .Type "RETURN"
  1537.         .HardReturn
  1538.         .HardReturn
  1539.     
  1540.         .Type "//****************************************"
  1541.         .HardReturn
  1542.         .Type "//    PROCEDURE: WaitMsgInit ()"
  1543.         .HardReturn
  1544.         .Type "//    PURPOSE: Initializes macro wait messages."
  1545.         .HardReturn
  1546.         .Type "//****************************************"
  1547.         .HardReturn
  1548.         .Type "PROCEDURE WaitMsgInit()"
  1549.         .HardReturn
  1550.         .Type "DialogDefine (" & QUOTE & "WaitMsg" & QUOTE & "; 50; 50; 150; 36; 16; " & QUOTE & "Please Wait" & QUOTE & ")"
  1551.         .HardReturn
  1552.         .Type "DialogAddText (" & QUOTE & "WaitMsg" & QUOTE & "; " & QUOTE & "WaitText" & QUOTE & "; 8; 14; 144; 16; 1; " & QUOTE & QUOTE & ")"
  1553.         .HardReturn
  1554.         .Type "DialogLoad (" & QUOTE & "WaitMsg" & QUOTE & ")"
  1555.         .HardReturn
  1556.         .Type "Return"
  1557.         .HardReturn
  1558.         .Type "ENDPROC"
  1559.         .HardReturn
  1560.         .HardReturn
  1561.  
  1562.         .Type "//****************************************"
  1563.         .HardReturn
  1564.         .Type "//    PROCEDURE: WaitMsgDisplay (Text)"
  1565.         .HardReturn
  1566.         .Type "//    PURPOSE: Displays a previously defined wait message dialog."
  1567.         .HardReturn
  1568.         .Type "//****************************************"
  1569.         .HardReturn
  1570.         .Type "PROCEDURE WaitMsgDisplay (Text)"
  1571.         .HardReturn
  1572.         .Type "RegionSetWindowText (" & QUOTE & "WaitMsg" & QUOTE & " + " & QUOTE & ".WaitText" & QUOTE & "; Text)"
  1573.         .HardReturn
  1574.         .Type "DialogShow (" & QUOTE & "WaitMsg" & QUOTE & ";; WaitDlgCallBack)"
  1575.         .HardReturn
  1576.         .Type "ENDPROC"
  1577.         .HardReturn
  1578.         .HardReturn
  1579.  
  1580.         .Type "PROCEDURE WaitDlgCallBack ()"
  1581.         .HardReturn
  1582.         .Type "If (WaitDlgCallBack[5] = 274 And WaitDlgCallBack[6] = 61536)"
  1583.         .HardReturn
  1584.         .Type "    Assert (CancelCondition!)"
  1585.         .HardReturn
  1586.         .Type "EndIf"
  1587.         .HardReturn
  1588.         .Type "ENDPROC"
  1589.         .HardReturn
  1590.         .HardReturn
  1591.  
  1592.         .Type "//****************************************"
  1593.         .HardReturn
  1594.         .Type "//    PROCEDURE: WaitMsgHide"
  1595.         .HardReturn
  1596.         .Type "//    PURPOSE: Hides a previously defined wait message dialog."
  1597.         .HardReturn
  1598.         .Type "//****************************************"
  1599.         .HardReturn
  1600.         .Type "PROCEDURE WaitMsgHide ()"
  1601.         .HardReturn
  1602.         .Type "DialogUndisplay (" & QUOTE & "WaitMsg" & QUOTE & "; " & QUOTE & "WaitText" & QUOTE & ")"
  1603.         .HardReturn
  1604.         .Type "ENDPROC"
  1605.         .HardReturn
  1606.         .HardReturn
  1607.  
  1608.         .FileSave QPFile$
  1609.         .ExitWordPerfect
  1610.     END WITHOBJECT
  1611. WAIT FOR 2
  1612. END SUB
  1613.  
  1614.  
  1615.  
  1616. ' **************************************************************************************
  1617. ' UseExcel 
  1618. ' This subroutine writes style info to a text file, then launches Excel and 
  1619. ' reads the style info from the text file into Excel
  1620. ' PARAMS:None
  1621. ' **************************************************************************************
  1622. SUB UseExcel
  1623. ON ERROR GOTO ErrorHandler
  1624.     'create file to use as Excel auto close macro
  1625.     CreateAutoCloseFile
  1626.  
  1627.     'create string for macro [ExcelPar.xls]
  1628.     MacroLocale$ = VenturaDir$ & "\Ventura\Scripts\ExcelPar.xls"
  1629.     IF INSTR(MacroLocale$, " ") <> 0 THEN    'no spaces in path, don't use quotes
  1630.         MacroLocale$ = QUOTE & MacroLocale$ & QUOTE    'spaces in path, enclose in quotes
  1631.     ENDIF
  1632.  
  1633.     'create string for executable command [Excel path + Excel macro name and path]
  1634.     ExcelPath$ = REGISTRYQUERY(HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\EXCEL.EXE","")
  1635.     exeName$ = ExcelPath$ & " " & MacroLocale$ 
  1636.  
  1637.     'write para tag info to temporary text file
  1638.     TempTextDir$ = GETTEMPFOLDER()
  1639.     TempTextFile$ = TempTextDir$ & "TempTextFile.txt"
  1640.     NEWLINE$ = CHR(13)
  1641.     TITLE_PREFIX$ = "@Title = "
  1642.     SECTION_PREFIX$ = "@Section = Paragraph Tag Properties"
  1643.     DIALOG_PREFIX$ = "@Dialog = "
  1644.     TAG_PREFIX$ = "@Tag Name = "    
  1645.     SPACE_CHAR$ = SPACE(8)
  1646.     PREFIX_CHAR$ = SPACE(8)
  1647.     UNITS_PREFIX$ = " *"
  1648.  
  1649.     BEGINWAITCURSOR
  1650.     UseTextFile(TempTextFile$)
  1651.     ENDWAITCURSOR
  1652.  
  1653.     'launch Excel and execute macro
  1654.     BEGINWAITCURSOR
  1655.     STARTPROCESS(exeName$)
  1656.     ENDWAITCURSOR
  1657.  
  1658.     'launch Excel and execute macro
  1659. REM     BEGINWAITCURSOR
  1660. REM     WinID& = FindWindow("XLMAIN", 0)
  1661. REM     WinID& = FindWindow("XLMAIN", 0)
  1662. REM     IF WinID& <> 0 THEN     'Excel is open
  1663. REM         x& = ShellExecute(WinID&, "open", MacroLocale$, "", "", SW_SHOWNORMAL ) 
  1664. REM     ELSE
  1665. REM         STARTPROCESS(exeName$)
  1666. REM     ENDIF
  1667. REM 
  1668. REM     ENDWAITCURSOR
  1669.     
  1670. SubEnd:
  1671. EXIT SUB
  1672.  
  1673. ErrorHandler:
  1674.     SELECT CASE ErrNum
  1675.         CASE ELSE
  1676.             MESSAGE "Error" & STR(ErrNum)
  1677.             RESUME AT SubEnd
  1678.     END SELECT
  1679.  
  1680. END SUB
  1681.  
  1682.  
  1683. ' **************************************************************************************
  1684. ' CreateAutoCloseFile 
  1685. ' This subroutine creatyes the AutoClose macro used by Excel to  extract the 
  1686. ' para tag info from the spreadsheet and bring it back into Ventura
  1687. ' PARAMS:None
  1688. ' **************************************************************************************
  1689. SUB CreateAutoCloseFile
  1690.     CLOSE
  1691.     'open text file to write code to for Excel autoclose macro
  1692.     TempTextDir$ = GETTEMPFOLDER()
  1693.     AutoCloseFile$ = TempTextDir$ & "SaveCode.txt"
  1694.     OPEN AutoCloseFile$ FOR OUTPUT AS  1
  1695.  
  1696.     PRINT #1, "Declare Function GetTempPath Lib " & QUOTE & "kernel32" & QUOTE  & "Alias" & QUOTE  & "GetTempPathA" & QUOTE & "(ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long" 
  1697.     PRINT #1, "'this sub runs when the file is closed and promts the user whether to to apply changes to Ventura"
  1698.     PRINT #1, "Sub Auto_Close()"
  1699.     PRINT #1,
  1700.     PRINT #1, "On Error Resume Next"
  1701.  
  1702.     PRINT #1, "SheetNum = 1"
  1703.     PRINT #1, "With Worksheets(SheetNum)"
  1704.     PRINT #1, "   Worksheets(SheetNum).Activate"
  1705.     PRINT #1, "   TitleText = .Cells(1, 2).Formula"
  1706.     PRINT #1, "End With"
  1707.     PRINT #1, 
  1708.     PRINT #1, "Msg = " & QUOTE & "Do you want to save changes to " & QUOTE & " + TitleText + " & QUOTE & "?" & QUOTE 
  1709.  
  1710.     PRINT #1, "Style = vbYesNoCancel + vbQuestion + vbDefaultButton2"
  1711.     PRINT #1, "Title = " & QUOTE & "Microsoft Excel" & QUOTE
  1712.     PRINT #1,
  1713.  
  1714.     PRINT #1, "SaveResponse = MsgBox(Msg, Style, Title)"
  1715.     PRINT #1, "If SaveResponse = vbYes Then"   
  1716.     PRINT #1, "    fileSaveName = Application.GetSaveAsFilename(fileFilter:=" & QUOTE & "Microsoft Excel Workbook (*.xls), *.xls" & QUOTE & ")"
  1717.     PRINT #1, "    If fileSaveName <> False Then"
  1718.        PRINT #1, "        ActiveWorkbook.SaveAs filename:=fileSaveName"
  1719.        PRINT #1, "    End If"
  1720.        PRINT #1, "ElseIf SaveResponse = vbCancel Then"
  1721.        PRINT #1, "    Workbooks(TitleText).Activate"
  1722.        PRINT #1, "    Exit Sub"
  1723.        PRINT #1, "End If"
  1724.        PRINT #1,     
  1725.  
  1726.        PRINT #1, "Msg = " & QUOTE & "Do you want to apply changes to VENTURA ?" & QUOTE 
  1727.        PRINT #1, "Style = vbYesNoCancel + vbQuestion + vbDefaultButton2"
  1728.        PRINT #1, "Title = " & QUOTE & "Microsoft Excel" & QUOTE 
  1729.        PRINT #1,
  1730.        PRINT #1, "ApplyResponse = MsgBox(Msg, Style, Title)"
  1731.        PRINT #1, "If ApplyResponse = vbYes Then"   
  1732.        PRINT #1, "    ApplyChanges"   
  1733.        PRINT #1, "    ActiveWorkbook.Close saveChanges:=False"   
  1734.        PRINT #1, "ElseIf ApplyResponse = vbCancel Then"   
  1735.        PRINT #1, "     Exit Sub"   
  1736.        PRINT #1, "Else"
  1737.        PRINT #1, "    ActiveWorkbook.Close saveChanges:=False"
  1738.        PRINT #1, "End If"
  1739.        PRINT #1, "End Sub"
  1740.        PRINT #1,
  1741.        PRINT #1,
  1742.  
  1743.        PRINT #1, "Sub ApplyChanges()"
  1744.        PRINT #1, "Dim TempPath$"
  1745.        PRINT #1, "Dim TempPathLength&"
  1746.        PRINT #1, "TempPath$ = Space(255)"
  1747.        PRINT #1, "TempPathLength& = 255"
  1748.        PRINT #1, "PathLength& = GetTempPath(TempPathLength&, TempPath$)"
  1749.        PRINT #1, "TempPath$ = Left$(TempPath$, PathLength&)"
  1750.        PRINT #1, "TempFile$ = " & "TempPath$" & " + "& QUOTE & "TempTextFile.TXT" & QUOTE
  1751.        PRINT #1, "If PathLength& > 0 Then"
  1752.        PRINT #1, "    ChDir (TempPath$)"
  1753.        PRINT #1, "Else"
  1754.        PRINT #1, "    MsgBox ("& QUOTE & "Cannot locate temporary directory" & QUOTE & ")"
  1755.        PRINT #1, "    Stop"
  1756.        PRINT #1, "End If"
  1757.        PRINT #1,
  1758.  
  1759.        PRINT #1, "SheetNum = 1"
  1760.        PRINT #1, "With Worksheets(SheetNum)"
  1761.       PRINT #1, "Close"
  1762.     PRINT #1, "Open TempFile$ For Output As #1"
  1763.     PRINT #1, "Worksheets(SheetNum).Activate"
  1764.     PRINT #1, "TitleText = .Cells(1, 2).Formula"
  1765.     PRINT #1, " SectionText = .Cells(2, 2).Formula"
  1766.     PRINT #1, "Print #1, " & QUOTE & "EXCEL" & QUOTE 
  1767.     PRINT #1, "Print #1, " & QUOTE & "EXCEL" & QUOTE 
  1768.     PRINT #1, "Print #1, " & QUOTE & "@Title = " & QUOTE & "; TitleText"
  1769.     PRINT #1, "Print #1, " & QUOTE & "@Section = " & QUOTE & "; SectionText"
  1770.     PRINT #1, "Print #1,"
  1771.  
  1772.     PRINT #1, "r = 6"
  1773.     PRINT #1, "c = 1"
  1774.     PRINT #1, "'LOOP for every tag"
  1775.     PRINT #1, "Do"
  1776.     PRINT #1, "       TagName = .Cells(r, 1).Formula"
  1777.     PRINT #1, "       If TagName = " & QUOTE & QUOTE & " Then Exit Do"
  1778.     PRINT #1, "       Print #1,"      
  1779.     PRINT #1, "       Print #1, " & QUOTE & "@TagName = " & QUOTE & "; TagName"
  1780.     PRINT #1, "       c = 2"
  1781.     PRINT #1, "    Do"
  1782.     PRINT #1, "       DialogLabel = .Cells(3, c).Formula"
  1783.     PRINT #1, "       If DialogLabel <> " & QUOTE & QUOTE & " Then"
  1784.     PRINT #1, "           Print #1," 
  1785.     PRINT #1, "           Print #1, " & QUOTE & "@Dialog = Paragraph Properties : " & QUOTE & "; DialogLabel"
  1786.     PRINT #1, "       End If"
  1787.     PRINT #1, "       AttributeLabel = .Cells(4, c).Formula"
  1788.     PRINT #1, "       AttributeValue = .Cells(r, c).Formula"
  1789.     PRINT #1, "       AttributeUnit = .Cells(5, c).Formula"
  1790.     PRINT #1, "       If AttributeLabel <> " & QUOTE & QUOTE & " Then"
  1791.     PRINT #1, "           If AttributeUnit <> " & QUOTE & QUOTE & " Then"
  1792.     PRINT #1, "              Print #1, Spc(5); AttributeLabel; Spc(5); AttributeValue; " & QUOTE & " *" & QUOTE & "; AttributeUnit"
  1793.     PRINT #1, "         Else"
  1794.     PRINT #1, "              Print #1, Spc(5); AttributeLabel; Spc(5); AttributeValue"
  1795.     PRINT #1, "         End If"
  1796.     PRINT #1, "       End If"
  1797.     PRINT #1, "       c = c + 1"
  1798.     PRINT #1, "    Loop Until AttributeLabel = " & QUOTE & QUOTE
  1799.     PRINT #1, "    r = r + 1"           
  1800.     PRINT #1, "Loop Until TagName = " & QUOTE & QUOTE
  1801.     PRINT #1, "Close #1"
  1802.     PRINT #1, "End With"
  1803.     PRINT #1, "RetVal = Shell(" & QUOTE & VenturaDir$ & "\VENTURA\SCRIPTS\NEWSTYLE.EXE" & QUOTE & ", 1)"
  1804.     PRINT #1, "End Sub"
  1805.     CLOSE
  1806. END SUB
  1807.  
  1808.  
  1809. ' **************************************************************************************
  1810. ' UseTextFile
  1811. ' This function obtains the para tag information for each Paragraph tag in the specified 
  1812. ' publication, and writes this information to the specified text file.
  1813. ' PARAMS: Name of text file to use
  1814. '
  1815. ' RETURNS: UseTextFile AS INTEGER - Integer indicating dialog return value(user selection)
  1816. ' **************************************************************************************
  1817. SUB UseTextFile(TextFile$)
  1818.  
  1819. WITHOBJECT OBJECT_VENTURA8
  1820.     CLOSE    ' close any text files that might have been left open
  1821.     OPEN TextFile$ FOR OUTPUT AS  1 
  1822.     NameOfPub$=UCASE(InputFile$)
  1823.     
  1824.     'print directories to text file if outputting to a spreadsheet
  1825.     IF SelectedApp& = PUBLISH_TO_QUATTROPRO OR SelectedApp& = PUBLISH_TO_EXCEL THEN 
  1826.         PRINT #1, VenturaDir$ & NEWLINE$
  1827.         PRINT #1, OutputFile$ & NEWLINE$
  1828.     ENDIF
  1829.     PRINT #1, TITLE_PREFIX$ & NameOfPub$ & NEWLINE$
  1830.  
  1831.     'display master page settings if outputting to Ventura or Text file
  1832.     IF SelectedApp& = PUBLISH_TO_VENTURA OR SelectedApp& = PUBLISH_TO_TEXT THEN 
  1833.         PRINT #1, "@Main Heading = Page Tag Properties" & NEWLINE$
  1834.         MPCount& = .MasterPageCount()
  1835.         ' get settings for each master page
  1836.         FOR i% = 1 TO MPCount&
  1837.             CurrentMP$ = .MasterPageGetAt(i%)
  1838.             GetMasterPageGeneral CurrentMP$        'get general master page settings
  1839.             PRINT #1, DIALOG_PREFIX$ & "Page Tag Properties : Left Page Margins" & NEWLINE$
  1840.             GetMasterPageMargins CurrentMP$, FALSE    'get margin settings for LEFT Master page
  1841.             PRINT #1, DIALOG_PREFIX$ & "Page Tag Properties : Right Page Margins" & NEWLINE$
  1842.             GetMasterPageMargins CurrentMP$, TRUE    'get margin settings for RIGHT Master page
  1843.             PRINT #1, DIALOG_PREFIX$ & "Page Tag Properties : Left Page Columns" & NEWLINE$
  1844.             GetMasterPageColumns CurrentMP$, FALSE    'get column settings for LEFT Master page
  1845.             PRINT #1, DIALOG_PREFIX$ & "Page Tag Properties : Right Page Columns" & NEWLINE$
  1846.             GetMasterPageColumns CurrentMP$, TRUE    'get column settings for RIGHT Master page
  1847.         NEXT i%
  1848.     ENDIF
  1849.     .ViewPageLayout        ' make sure PageLayout view is active
  1850.  
  1851.     'heading for paragraph tag settings
  1852.     PRINT #1, SECTION_PREFIX$ & NEWLINE$
  1853.  
  1854.     NumTags%=.ParaTagCount()        'get total number of tags in the publication
  1855.     ' get para tag attributes for every para tag
  1856.     FOR i%=1 TO NumTags%
  1857.         TagName$=.ParaTagGetAt(i)
  1858.         IF TagName$ = "" THEN GOTO AllDone
  1859.         PRINT #1, CHR(13)
  1860.         PRINT #1, CHR(13)
  1861.         PRINT #1, TAG_PREFIX$ & TagName$ & NEWLINE$
  1862.  
  1863.         .FormatParaTagBegin TagName$    ' specify which tag to get attributes for 
  1864.         GetParaFontInfo            ' get paragraph font attributes
  1865.         GetParaColorInfo FALSE        ' get paragraph color attributes for FONT    
  1866.         GetParaColorInfo TRUE        ' get paragraph color attributes for BACKGROUND
  1867.         GetParaEffects                ' get paragraph effects 
  1868.         GetEffectFontInfo            ' get paragraph effect font attributes
  1869.         GetEffectColorInfo FALSE        ' get paragraph effect font color attributes for FONT    
  1870.         GetEffectColorInfo TRUE        ' get paragraph effect font color attributes for BACKGROUND
  1871.  
  1872.         GetParaAlignmentInfo        ' get paragraph alignment attributes
  1873.         GetParaSpacingInfo            ' get paragraph spacing attributes
  1874.         GetParaTabInfo                ' get paragraph tab attributes
  1875.         GetParaBreaksInfo            ' get paragraph breaks attributes
  1876.         GetParaHyphenationInfo        ' get paragraph hyphenation attributes
  1877.         GetParaTypographyInfo        ' get paragraph typography attributes
  1878.         GetParaDefaultsInfo            ' get paragraph default attributes
  1879.         PRINT #1, NEWLINE$            '
  1880.     NEXT i
  1881.  
  1882. AllDone:
  1883.         IF CloseVal&=1 THEN .FileClose 2    'Close vent pub if user wants to
  1884.         CLOSE 1                        'Close text file 
  1885.     END WITHOBJECT
  1886. END SUB
  1887.  
  1888.  
  1889. ' **************************************************************************************
  1890. ' GetMasterPageGeneral
  1891. ' This subroutine obtains the general settings for the master page specified by MasterPageName$, 
  1892. ' and prints the information to the open text file
  1893. ' PARAMS: MasterPageName$ - the name of the master page from which attributes are to be obtained
  1894. ' **************************************************************************************
  1895. SUB GetMasterPageGeneral(MasterPageName$)
  1896. DIM Orientation AS BOOLEAN
  1897.  
  1898.     WITHOBJECT OBJECT_VENTURA8
  1899.  
  1900.         .FormatMasterPageGet Orientation, PaperType&, Width&, Height&, MasterPageName$
  1901.         PRINT #1, "@Minor Heading = " & "Page Tag Name = " & MasterPageName$ & NEWLINE$
  1902.         PRINT #1, DIALOG_PREFIX$ & "Page Tag Properties : General" & NEWLINE$
  1903.         IF Orientation = FALSE THEN 
  1904.             PRINT #1, PREFIX_CHAR$ & "Page Orientation: " & SPACE_CHAR$ & "Landscape" & NEWLINE$
  1905.         ELSE
  1906.             PRINT #1, PREFIX_CHAR$ & "Page Orientation: " & SPACE_CHAR$ & "Portrait" & NEWLINE$
  1907.         END IF
  1908.     
  1909.         SELECT CASE PaperType&
  1910.             CASE 0    : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "Letter" & NEWLINE$
  1911.             CASE 1    : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "Legal" & NEWLINE$
  1912.             CASE 2    : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "Tabloid"  & NEWLINE$
  1913.             CASE 3    : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "Statement/Half" & NEWLINE$
  1914.             CASE 4    : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "Executive" & NEWLINE$
  1915.             CASE 5    : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "Fan fold" & NEWLINE$
  1916.             CASE 6    : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "Double"  & NEWLINE$
  1917.             CASE 7    : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "Broad sheet" & NEWLINE$
  1918.             CASE 8    : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "A2" & NEWLINE$
  1919.             CASE 9    : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "A3" & NEWLINE$
  1920.             CASE 10    : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "A4"  & NEWLINE$
  1921.             CASE 11    : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "A5" & NEWLINE$
  1922.             CASE 12    : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "A6" & NEWLINE$
  1923.             CASE 13    : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "B4" & NEWLINE$
  1924.             CASE 14    : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "B5"  & NEWLINE$
  1925.             CASE 15    : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "C3" & NEWLINE$
  1926.             CASE 16    : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "C4" & NEWLINE$
  1927.             CASE 17    : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "C5" & NEWLINE$
  1928.             CASE 18    : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "C6"  & NEWLINE$
  1929.             CASE 19    : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "RA2" & NEWLINE$
  1930.             CASE 20    : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "RA3"  & NEWLINE$
  1931.             CASE 21    : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "RA4" & NEWLINE$
  1932.             CASE 22    : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "SRA3" & NEWLINE$
  1933.             CASE 23    : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "SRA4" & NEWLINE$
  1934.             CASE 24    : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "Envelope #9"  & NEWLINE$
  1935.             CASE 25    : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "Envelope #10" & NEWLINE$
  1936.             CASE 26    : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "Envelope #11" & NEWLINE$
  1937.             CASE 27    : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "Envelope #12" & NEWLINE$
  1938.             CASE 28    : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "Envelope #14"  & NEWLINE$
  1939.             CASE 29    : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "Envelope monarch" & NEWLINE$
  1940.             CASE 30    : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "Envelope check"  & NEWLINE$
  1941.             CASE 31    : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "DL" & NEWLINE$
  1942.             CASE 32    : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "German fan fold" & NEWLINE$
  1943.             CASE 33    : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "German legal fan fold" & NEWLINE$
  1944.             CASE 34    : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "Custom"  & NEWLINE$
  1945.             CASE ELSE    : PRINT #1, PREFIX_CHAR$ & "Paper Type: " & SPACE_CHAR$ & "Unknown" & NEWLINE$
  1946.         END SELECT
  1947.         DBLWidth# = CDBL(Width&)
  1948.         ConvertTo DimensionUnits&, DBLWidth#
  1949.         PRINT #1, PREFIX_CHAR$ & "Page Width: " & SPACE_CHAR$ & DBLWidth# & UNITS_PREFIX$  & Units$(DimensionUnits&) & NEWLINE$
  1950.         DBLHeight# = CDBL(Height&)
  1951.         ConvertTo DimensionUnits&, DBLHeight#
  1952.         PRINT #1, PREFIX_CHAR$ & "Page Height: " & SPACE_CHAR$ & DBLHeight# & UNITS_PREFIX$  & Units$(DimensionUnits&) & NEWLINE$
  1953.     END WITHOBJECT
  1954. END SUB
  1955.  
  1956.  
  1957. ' **************************************************************************************
  1958. ' GetMasterPageMargins
  1959. ' This subroutine obtains the margin settings for the master page specified by MasterPageName$, 
  1960. ' and prints the information to the open text file
  1961. ' PARAMS: MasterPageName$ - the name of the master page from which attributes are to be obtained
  1962. '         PageType AS BOOLEAN - indicates whether to use the left or right master page
  1963. '                        - FALSE - use LEFT page
  1964. '                        - TRUE - use RIGHT page
  1965. ' **************************************************************************************
  1966. SUB GetMasterPageMargins(MasterPageName$, PageType AS BOOLEAN)
  1967.     WITHOBJECT OBJECT_VENTURA8
  1968.         .ViewMasterPage        'switch to master page view
  1969.         .ViewGotoMasterPage MasterPageName$, PageType, 4        'activate the specified master page
  1970.     
  1971.          .FormatFrameMarginsInsideGet 1, LeftMarg&, RightMarg&, TopMarg&, BottomMarg&
  1972.     
  1973.         DBLTopMarg# = CDBL(TopMarg&)
  1974.         ConvertTo MarginUnits&, DBLTopMarg#
  1975.         PRINT #1, PREFIX_CHAR$ & "Top: " & SPACE_CHAR$ & DBLTopMarg# & UNITS_PREFIX$  & Units$(MarginUnits&) & NEWLINE$
  1976.     
  1977.         DBLBottomMarg# = CDBL(BottomMarg&)
  1978.         ConvertTo MarginUnits&, DBLBottomMarg#
  1979.         PRINT #1, PREFIX_CHAR$ & "Bottom: " & SPACE_CHAR$ & DBLBottomMarg# & UNITS_PREFIX$  & Units$(MarginUnits&) & NEWLINE$
  1980.     
  1981.         DBLLeftMarg# = CDBL(LeftMarg&)
  1982.         ConvertTo MarginUnits&, DBLLeftMarg#
  1983.         PRINT #1, PREFIX_CHAR$ & "Left: " & SPACE_CHAR$ & DBLLeftMarg# & UNITS_PREFIX$  & Units$(MarginUnits&) & NEWLINE$
  1984.     
  1985.         DBLRightMarg# = CDBL(RightMarg&)
  1986.         ConvertTo MarginUnits&, DBLRightMarg#
  1987.         PRINT #1, PREFIX_CHAR$ & "Right: " & SPACE_CHAR$ & DBLRightMarg# & UNITS_PREFIX$  & Units$(MarginUnits&) & NEWLINE$
  1988.     END WITHOBJECT
  1989. END SUB
  1990.  
  1991.  
  1992. ' **************************************************************************************
  1993. ' GetMasterPageColumns
  1994. ' This subroutine obtains the column settings for the master page specified by MasterPageName$, 
  1995. ' and prints the information to the open text file
  1996. ' PARAMS: MasterPageName$ - the name of the master page from which attributes are to be obtained
  1997. '         PageType AS BOOLEAN - indicates whether to use the left or right master page
  1998. '                        - FALSE - use LEFT page
  1999. '                        - TRUE - use RIGHT page
  2000. ' **************************************************************************************
  2001. SUB GetMasterPageColumns(MasterPageName$, PageType AS BOOLEAN)
  2002. DIM GutterRuleOverprint AS BOOLEAN
  2003.     WITHOBJECT OBJECT_VENTURA8
  2004.         .ViewMasterPage
  2005.         .ViewGotoMasterPage MasterPageName$, PageType, 4
  2006.          .FormatFrameColumnsGet 1, Columns&, FlowInColumns&, ColumnBalance&, GutterRuleOverprint
  2007.         PRINT #1, PREFIX_CHAR$ & "Number of Columns: " & SPACE_CHAR$ & Columns& & NEWLINE$
  2008.         SELECT CASE FlowInColumns&
  2009.             CASE 1    : PRINT #1, PREFIX_CHAR$ & "Flow In Columns: " & SPACE_CHAR$ & "left to right" & NEWLINE$
  2010.             CASE 2    : PRINT #1, PREFIX_CHAR$ & "Flow In Columns: " & SPACE_CHAR$ & "right to left" & NEWLINE$
  2011.         END SELECT
  2012.         SELECT CASE ColumnBalance&
  2013.             CASE 0    : PRINT #1, PREFIX_CHAR$ & "Column Balance: " & SPACE_CHAR$ & "Off" & NEWLINE$
  2014.             CASE 1    : PRINT #1, PREFIX_CHAR$ & "Column Balance: " & SPACE_CHAR$ & "On" & NEWLINE$
  2015.             CASE 2    : PRINT #1, PREFIX_CHAR$ & "Column Balance: " & SPACE_CHAR$ & "Default" & NEWLINE$
  2016.         END SELECT
  2017.         IF GutterRuleOverprint = -1 THEN    'temp fix for Booleans; replace -1 with TRUE when fixed
  2018.             PRINT #1, PREFIX_CHAR$ & "Gutter Rule Overprint: " & SPACE_CHAR$ & "ON" & NEWLINE$
  2019.         ELSE
  2020.             PRINT #1, PREFIX_CHAR$ & "Gutter Rule Overprint: " & SPACE_CHAR$ & "OFF" & NEWLINE$
  2021.         ENDIF
  2022.     
  2023.         IF Columns& > 1 THEN 
  2024.             FOR j% = 1 TO Columns& -1    'last column doesn't have gutter properties
  2025.                  .FormatFrameColumnGetAt 1, j%, Width&, GutterWidth&, RuleWidth&, ColorModel&, Color1&, Color2&, Color3&, Color4&
  2026.                 DBLWidth# = CDBL(Width&)
  2027.                 ConvertTo MarginUnits&, DBLWidth#
  2028.                 PRINT #1, PREFIX_CHAR$ & "Column " & j% & " Width: " & SPACE_CHAR$ & DBLWidth# & UNITS_PREFIX$  & Units$(MarginUnits&) & NEWLINE$
  2029.                 DBLGutterWidth# = CDBL(GutterWidth&)
  2030.                 ConvertTo LineUnits&, DBLGutterWidth#
  2031.                 PRINT #1, PREFIX_CHAR$ & "Column " & j% & " Gutter Width: " & SPACE_CHAR$ & DBLGutterWidth# & UNITS_PREFIX$  & Units$(LineUnits&) & NEWLINE$
  2032.                 DBLRuleWidth# = CDBL(RuleWidth&)
  2033.                 ConvertTo LineUnits&, DBLRuleWidth#
  2034.                 PRINT #1, PREFIX_CHAR$ & "Column " & j% & " Gutter Rule Width: " & SPACE_CHAR$ & DBLRuleWidth# & UNITS_PREFIX$  & Units$(LineUnits&) & NEWLINE$
  2035.             NEXT j%
  2036.                  .FormatFrameColumnGetAt 1, j%, Width&
  2037.             DBLWidth# = CDBL(Width&)
  2038.             ConvertTo MarginUnits&, DBLWidth#
  2039.             PRINT #1, PREFIX_CHAR$ & "Column " & j% & " Width: " & SPACE_CHAR$ & DBLWidth# & UNITS_PREFIX$  & Units$(MarginUnits&) & NEWLINE$
  2040.         ENDIF
  2041.     END WITHOBJECT
  2042. END SUB
  2043.  
  2044.  
  2045. ' **************************************************************************************
  2046. ' GetParaFontInfo
  2047. ' This subroutine obtains the paragraph font information for the active paragraph tag
  2048. ' **************************************************************************************
  2049. SUB GetParaFontInfo
  2050. DIM StrikeThru AS BOOLEAN
  2051. DIM Overscore AS BOOLEAN
  2052. DIM Uppercase AS BOOLEAN
  2053. DIM Italic AS BOOLEAN
  2054.  
  2055.     WITHOBJECT OBJECT_VENTURA8
  2056.         PRINT #1, DIALOG_PREFIX$ & "Paragraph Properties : Font" & NEWLINE$
  2057.         .FormatParaFontGet FontName$, PointSize!, Weight&, Italic, Underline&, StrikeThru, Overscore, Uppercase
  2058.     
  2059.         PRINT #1, PREFIX_CHAR$ & "Font Name: " & SPACE_CHAR$ & FontName$ & NEWLINE$
  2060.         DBLPointSize# = CDBL(PointSize!)
  2061.         ConvertTo FontUnits&, FROMPOINTS(DBLPointSize#)
  2062.         Round DBLPointSize#, .010
  2063.         PRINT #1, PREFIX_CHAR$ & "Point Size: " & SPACE_CHAR$ & DBLPointSize# & UNITS_PREFIX$ & Units$(FontUnits&) & NEWLINE$
  2064.     
  2065.         SELECT CASE Weight&
  2066.             CASE 100    : PRINT #1, PREFIX_CHAR$ & "Weight: " & SPACE_CHAR$ & "Thin" & NEWLINE$
  2067.             CASE 200    : PRINT #1, PREFIX_CHAR$ & "Weight: " & SPACE_CHAR$ & "Extra Light, Ultra Light" & NEWLINE$
  2068.             CASE 300    : PRINT #1, PREFIX_CHAR$ & "Weight: " & SPACE_CHAR$ & "Light" & NEWLINE$
  2069.             CASE 400    : PRINT #1, PREFIX_CHAR$ & "Weight: " & SPACE_CHAR$ & "Normal, Regular" & NEWLINE$
  2070.             CASE 500    : PRINT #1, PREFIX_CHAR$ & "Weight: " & SPACE_CHAR$ & "Medium" & NEWLINE$
  2071.             CASE 600    : PRINT #1, PREFIX_CHAR$ & "Weight: " & SPACE_CHAR$ & "Semi Bold, Demi Bold" & NEWLINE$
  2072.             CASE 700    : PRINT #1, PREFIX_CHAR$ & "Weight: " & SPACE_CHAR$ & "Bold" & NEWLINE$
  2073.             CASE 800    : PRINT #1, PREFIX_CHAR$ & "Weight: " & SPACE_CHAR$ & "Extra Bold, Ultra Bold" & NEWLINE$
  2074.             CASE 900    : PRINT #1, PREFIX_CHAR$ & "Weight: " & SPACE_CHAR$ & "Black, Heavy" & NEWLINE$
  2075.             CASE ELSE    : PRINT #1, PREFIX_CHAR$ & "Weight: " & SPACE_CHAR$ & "Unknown" & NEWLINE$
  2076.         END SELECT
  2077.         IF Italic = -1 THEN     'temp fix for Booleans; replace -1 with TRUE when fixed
  2078.             PRINT #1, PREFIX_CHAR$ & "Italic: " & SPACE_CHAR$ & "ON" & NEWLINE$
  2079.         ELSE
  2080.             PRINT #1, PREFIX_CHAR$ & "Italic: " & SPACE_CHAR$ & "OFF" & NEWLINE$
  2081.         ENDIF
  2082.     
  2083.         'Text Before and After are properties of the Font dialog and should appear here
  2084.         .FormatParaEffectsGet EffectType&, TextAfter$, TextBefore$
  2085.         PRINT #1, PREFIX_CHAR$ & "Text Before: " & SPACE_CHAR$ & TextBefore$ & NEWLINE$
  2086.         PRINT #1, PREFIX_CHAR$ & "Text After: " & SPACE_CHAR$ & TextAfter$ & NEWLINE$
  2087.  
  2088.         SELECT CASE Underline&
  2089.             CASE 0    : PRINT #1, PREFIX_CHAR$ & "Underline: " & SPACE_CHAR$ & "None" & NEWLINE$
  2090.             CASE 1    : PRINT #1, PREFIX_CHAR$ & "Underline: " & SPACE_CHAR$ & "Single" & NEWLINE$
  2091.             CASE 2    : PRINT #1, PREFIX_CHAR$ & "Underline: " & SPACE_CHAR$ & "Double"  & NEWLINE$
  2092.             CASE 3    : PRINT #1, PREFIX_CHAR$ & "Underline: " & SPACE_CHAR$ & "Word underline" & NEWLINE$
  2093.             CASE ELSE    : PRINT #1, PREFIX_CHAR$ & "Underline: " & SPACE_CHAR$ & "Unknown" & NEWLINE$
  2094.         END SELECT
  2095.         IF StrikeThru = -1 THEN     'temp fix for Booleans; replace -1 with TRUE when fixed
  2096.             PRINT #1, PREFIX_CHAR$ & "Strike Thru: " & SPACE_CHAR$ & "ON" & NEWLINE$
  2097.         ELSE
  2098.             PRINT #1, PREFIX_CHAR$ & "Strike Thru: " & SPACE_CHAR$ & "OFF" & NEWLINE$
  2099.         ENDIF
  2100.         IF Overscore = -1 THEN     'temp fix for Booleans; replace -1 with TRUE when fixed
  2101.             PRINT #1, PREFIX_CHAR$ & "Overscore: " & SPACE_CHAR$ & "ON" & NEWLINE$
  2102.         ELSE
  2103.             PRINT #1, PREFIX_CHAR$ & "Overscore: " & SPACE_CHAR$ & "OFF" & NEWLINE$
  2104.         ENDIF
  2105.         IF Uppercase = -1 THEN     'temp fix for Booleans; replace -1 with TRUE when fixed
  2106.             PRINT #1, PREFIX_CHAR$ & "Uppercase: " & SPACE_CHAR$ & "ON" & NEWLINE$
  2107.         ELSE
  2108.             PRINT #1, PREFIX_CHAR$ & "Uppercase: " & SPACE_CHAR$ & "OFF" & NEWLINE$
  2109.         ENDIF
  2110.     END WITHOBJECT
  2111. END SUB
  2112.  
  2113.  
  2114. ' **************************************************************************************
  2115. ' GetParaColorInfo
  2116. ' This subroutine obtains the paragraph color information for the active paragraph tag
  2117. ' **************************************************************************************
  2118. SUB GetParaColorInfo(Background AS BOOLEAN)
  2119. REM DIM BackGround AS BOOLEAN
  2120. DIM Overprint AS BOOLEAN
  2121. DIM ColumnWide AS BOOLEAN
  2122.  
  2123.     WITHOBJECT OBJECT_VENTURA8
  2124.         .FormatParaColorGet BackGround, ColorModel&, Colour1&, Colour2&, Colour3&, Colour4&, Overprint, ColumnWide
  2125.         IF Background = -1 THEN     'temp fix for Booleans; replace -1 with TRUE when fixed
  2126.             PRINT #1, DIALOG_PREFIX$ & "Paragraph Properties : Background Color" & NEWLINE$
  2127. REM             PRINT #1, PREFIX_CHAR$ & "Background: " & SPACE_CHAR$ & "ON" & NEWLINE$
  2128.         ELSE
  2129.             PRINT #1, DIALOG_PREFIX$ & "Paragraph Properties : Font Color" & NEWLINE$
  2130. REM             PRINT #1, PREFIX_CHAR$ & "Background: " & SPACE_CHAR$ & "OFF" & NEWLINE$
  2131.         ENDIF
  2132.         SELECT CASE ColorModel&
  2133.             CASE 2    : PRINT #1, PREFIX_CHAR$ & "Color Model: " & SPACE_CHAR$ & "CMYK" & NEWLINE$
  2134.             CASE 3    : PRINT #1, PREFIX_CHAR$ & "Color Model: " & SPACE_CHAR$ & "CMYK255" & NEWLINE$
  2135.             CASE 4    : PRINT #1, PREFIX_CHAR$ & "Color Model: " & SPACE_CHAR$ & "CMY" & NEWLINE$
  2136.             CASE 5    : PRINT #1, PREFIX_CHAR$ & "Color Model: " & SPACE_CHAR$ & "RGB" & NEWLINE$
  2137.             CASE 6    : PRINT #1, PREFIX_CHAR$ & "Color Model: " & SPACE_CHAR$ & "HSB" & NEWLINE$
  2138.             CASE 7    : PRINT #1, PREFIX_CHAR$ & "Color Model: " & SPACE_CHAR$ & "HLS" & NEWLINE$
  2139.             CASE 9    : PRINT #1, PREFIX_CHAR$ & "Color Model: " & SPACE_CHAR$ & "Grayscale" & NEWLINE$
  2140.             CASE 11    : PRINT #1, PREFIX_CHAR$ & "Color Model: " & SPACE_CHAR$ & "YIQ" & NEWLINE$
  2141.             CASE 12    : PRINT #1, PREFIX_CHAR$ & "Color Model: " & SPACE_CHAR$ & "L*a*b*" & NEWLINE$
  2142.             CASE 13    : PRINT #1, PREFIX_CHAR$ & "Color Model: " & SPACE_CHAR$ & "Registration Color" & NEWLINE$
  2143.             CASE ELSE    : PRINT #1, PREFIX_CHAR$ & "Color Model: " & SPACE_CHAR$ & "Unavailable" & NEWLINE$
  2144.                       ColorModel& = 0 : Colour1& = 0 : Colour2& = 0 : Colour3& = 0 : Colour4& = 0
  2145.         END SELECT
  2146.         PRINT #1, PREFIX_CHAR$ & "Color 1: " & SPACE_CHAR$ & (Colour1&) & NEWLINE$
  2147.         PRINT #1, PREFIX_CHAR$ & "Color 2: " & SPACE_CHAR$ & (Colour2&) & NEWLINE$
  2148.         PRINT #1, PREFIX_CHAR$ & "Color 3: " & SPACE_CHAR$ & (Colour3&) & NEWLINE$
  2149.         PRINT #1, PREFIX_CHAR$ & "Color 4: " & SPACE_CHAR$ & (Colour4&) & NEWLINE$
  2150.         IF Overprint = -1 THEN     'temp fix for Booleans; replace -1 with TRUE when fixed
  2151.             PRINT #1, PREFIX_CHAR$ & "Overprint: " & SPACE_CHAR$ & "ON" & NEWLINE$
  2152.         ELSE
  2153.             PRINT #1, PREFIX_CHAR$ & "Overprint: " & SPACE_CHAR$ & "OFF" & NEWLINE$
  2154.         ENDIF
  2155.  
  2156.         ' only print ColumnWide param if background color
  2157.         IF Background = -1 THEN     'temp fix for Booleans; replace -1 with TRUE when fixed
  2158.             IF ColumnWide = -1 THEN     'temp fix for Booleans; replace -1 with TRUE when fixed
  2159.                 PRINT #1, PREFIX_CHAR$ & "Column Wide: " & SPACE_CHAR$ & "ON" & NEWLINE$
  2160.             ELSE
  2161.                 PRINT #1, PREFIX_CHAR$ & "Column Wide: " & SPACE_CHAR$ & "OFF" & NEWLINE$
  2162.             ENDIF
  2163.         ENDIF
  2164.     END WITHOBJECT
  2165. END SUB
  2166.  
  2167.  
  2168. ' **************************************************************************************
  2169. ' GetParaEffects
  2170. ' This subroutine obtains the effects information for the active paragraph tag
  2171. ' IF Effect type is Bullet, the paragraph bullet attributes are obtained.
  2172. ' IF Effect type is Drop Caps, the paragraph bullet attributes are obtained.
  2173. ' **************************************************************************************
  2174. SUB GetParaEffects
  2175.     WITHOBJECT OBJECT_VENTURA8
  2176.         PRINT #1, DIALOG_PREFIX$ & "Paragraph Properties : Effects" & NEWLINE$
  2177.         'Text Before and After now appears with the Font properties
  2178.         .FormatParaEffectsGet EffectType&    ', TextAfter$, TextBefore$
  2179.         SELECT CASE EffectType&
  2180.             CASE 0    : PRINT #1, PREFIX_CHAR$ & "Effect Type: " & SPACE_CHAR$ & "None" & NEWLINE$
  2181.             CASE 1    : PRINT #1, PREFIX_CHAR$ & "Effect Type: " & SPACE_CHAR$ & "Bullet" & NEWLINE$
  2182.             CASE 2    : PRINT #1, PREFIX_CHAR$ & "Effect Type: " & SPACE_CHAR$ & "Drop Cap" & NEWLINE$
  2183.             CASE ELSE    : PRINT #1, PREFIX_CHAR$ & "Effect Type: " & SPACE_CHAR$ & "Unknown" & NEWLINE$
  2184.         END SELECT
  2185.     
  2186.         IF EffectType& = 1 THEN         'IF Effect Type is Bullet, get Bullet attributes
  2187.             GetBulletInfo
  2188.         ELSEIF EffectType& = 2 THEN     'IF Effect Type is Drop Caps, get Drop Caps attributes
  2189.             GetDropCapsInfo
  2190.         ELSE                        'ELSE only print property headings if spreadsheet
  2191.             IF SelectedApp& = PUBLISH_TO_EXCEL OR SelectedApp& = PUBLISH_TO_QUATTROPRO THEN 
  2192.                 'property headings for Bullets
  2193.                 PRINT #1, DIALOG_PREFIX$ & "Paragraph Properties : Bullets" & NEWLINE$
  2194.                 PRINT #1, PREFIX_CHAR$ & "Indent: "
  2195.                 PRINT #1, PREFIX_CHAR$ & "Bullet Character: "
  2196.                 PRINT #1, PREFIX_CHAR$ & "Shift Up: "
  2197.                 PRINT #1, PREFIX_CHAR$ & "Indent First Line Only: "
  2198.                 'property headings for Drop Caps
  2199.                 PRINT #1, DIALOG_PREFIX$ & "Paragraph Properties : DropCaps" & NEWLINE$
  2200.                 PRINT #1, PREFIX_CHAR$ & "Character Count: " 
  2201.                 PRINT #1, PREFIX_CHAR$ & "Shift Up: " 
  2202.                 PRINT #1, PREFIX_CHAR$ & "Custom Line Count: " 
  2203.             ENDIF
  2204.         ENDIF
  2205.     END WITHOBJECT
  2206. END SUB
  2207.  
  2208.  
  2209. ' **************************************************************************************
  2210. ' GetBulletInfo
  2211. ' This subroutine obtains the Bullet attributes for the active paragraph tag
  2212. ' **************************************************************************************
  2213. SUB GetBulletInfo
  2214. DIM IndentFirstLineOnly As BOOLEAN
  2215.     WITHOBJECT OBJECT_VENTURA8
  2216.         .FormatParaBulletGet Indent&, BulletChar&, ShiftUpDef&, IndentFirstLineOnly
  2217.     
  2218.         PRINT #1, DIALOG_PREFIX$ & "Paragraph Properties : Bullets" & NEWLINE$
  2219.         DBLIndent# = CDBL(Indent&)
  2220.         ConvertTo VerticalUnits&, DBLIndent#
  2221.         PRINT #1, PREFIX_CHAR$ & "Indent: " & SPACE_CHAR$ & DBLIndent# & UNITS_PREFIX$  & Units$(VerticalUnits&) & NEWLINE$
  2222.         PRINT #1, PREFIX_CHAR$ & "Bullet Character: " & SPACE_CHAR$ & (BulletChar&) & UNITS_PREFIX$ & "ANSI" & NEWLINE$
  2223.         DBLShiftUpDef# = CDBL(ShiftUpDef&)
  2224.         ConvertTo HorizontalUnits&, DBLShiftUpDef#
  2225.         PRINT #1, PREFIX_CHAR$ & "Shift Up: " & SPACE_CHAR$ & DBLShiftUpDef# & UNITS_PREFIX$ & Units$(HorizontalUnits&) & NEWLINE$
  2226.         IF IndentFirstLineOnly = -1 THEN     'temp fix for Booleans; replace -1 with TRUE when fixed
  2227.             PRINT #1, PREFIX_CHAR$ & "Indent First Line Only: " & SPACE_CHAR$ & "ON" & NEWLINE$
  2228.         ELSE
  2229.             PRINT #1, PREFIX_CHAR$ & "Indent First Line Only: " & SPACE_CHAR$ & "OFF" & NEWLINE$
  2230.         ENDIF
  2231.         IF SelectedApp& = PUBLISH_TO_EXCEL OR SelectedApp& = PUBLISH_TO_QUATTROPRO THEN 
  2232.             'property headings for Drop Caps
  2233.             PRINT #1, DIALOG_PREFIX$ & "Paragraph Properties : DropCaps" & NEWLINE$
  2234.             PRINT #1, PREFIX_CHAR$ & "Character Count: " 
  2235.             PRINT #1, PREFIX_CHAR$ & "Shift Up: " 
  2236.             PRINT #1, PREFIX_CHAR$ & "Custom Line Count: " 
  2237.         ENDIF
  2238.     END WITHOBJECT
  2239. END SUB
  2240.  
  2241.  
  2242. ' **************************************************************************************
  2243. ' GetDropCapsInfo
  2244. ' This subroutine obtains the Drop Cap attributes for the active paragraph tag
  2245. ' **************************************************************************************
  2246. SUB GetDropCapsInfo
  2247.     WITHOBJECT OBJECT_VENTURA8
  2248.         IF SelectedApp& = PUBLISH_TO_EXCEL OR SelectedApp& = PUBLISH_TO_QUATTROPRO THEN 
  2249.             'property headings for Bullets
  2250.             PRINT #1, DIALOG_PREFIX$ & "Paragraph Properties : Bullets" & NEWLINE$
  2251.             PRINT #1, PREFIX_CHAR$ & "Indent: "
  2252.             PRINT #1, PREFIX_CHAR$ & "Bullet Character: "
  2253.             PRINT #1, PREFIX_CHAR$ & "Shift Up: "
  2254.             PRINT #1, PREFIX_CHAR$ & "Indent First Line Only: "
  2255.         ENDIF
  2256.         .FormatParaDropCapGet CharCount&, ShiftUpDropCap&, CustomLineCount&
  2257.         PRINT #1, DIALOG_PREFIX$ & "Paragraph Properties : DropCaps" & NEWLINE$
  2258.         PRINT #1, PREFIX_CHAR$ & "Character Count: " & SPACE_CHAR$ & (CharCount&) & NEWLINE$
  2259.         DBLShiftUpDropCap# = CDBL(ShiftUpDropCap&)
  2260.         ConvertTo HorizontalUnits&, DBLShiftUpDropCap#
  2261.         PRINT #1, PREFIX_CHAR$ & "Shift Up: " & SPACE_CHAR$ & DBLShiftUpDropCap# & UNITS_PREFIX$ & Units$(HorizontalUnits&) & NEWLINE$
  2262.         PRINT #1, PREFIX_CHAR$ & "Custom Line Count: " & SPACE_CHAR$ & (CustomLineCount&) & NEWLINE$
  2263.     END WITHOBJECT
  2264. END SUB
  2265.  
  2266.  
  2267. ' **************************************************************************************
  2268. ' GetEffectFontInfo
  2269. ' This subroutine obtains the Effect font attributes for the active paragraph tag
  2270. ' **************************************************************************************
  2271. SUB GetEffectFontInfo
  2272. DIM bEffectStrike AS BOOLEAN
  2273. DIM bEffectOverscore AS BOOLEAN
  2274. DIM bEffectItalic AS BOOLEAN
  2275.     WITHOBJECT OBJECT_VENTURA8
  2276.         .FormatParaEffectFontGet EffectFontName$, EffectPointSize!, EffectWeight&, bEffectItalic, EffectUnderline&, bEffectStrike, bEffectOverscore
  2277.         PRINT #1, DIALOG_PREFIX$ & "Paragraph Properties : Effect Font" & NEWLINE$
  2278.         PRINT #1, PREFIX_CHAR$ & "Effect Font Name: " & SPACE_CHAR$ & EffectFontName$ & NEWLINE$
  2279.         DBLEffectPointSize# = CDBL(EffectPointSize!)
  2280.         ConvertTo FontUnits&, FROMPOINTS(DBLEffectPointSize#)
  2281.         Round DBLEffectPointSize#, .010
  2282.         PRINT #1, PREFIX_CHAR$ & "Effect Point Size: " & SPACE_CHAR$ & DBLEffectPointSize# & UNITS_PREFIX$ & Units$(FontUnits&) & NEWLINE$
  2283.         SELECT CASE EffectWeight&
  2284.             CASE 100    : PRINT #1, PREFIX_CHAR$ & "Effect Weight: " & SPACE_CHAR$ & "Thin" & NEWLINE$
  2285.             CASE 200    : PRINT #1, PREFIX_CHAR$ & "Effect Weight: " & SPACE_CHAR$ & "Extra Light, Ultra Light" & NEWLINE$
  2286.             CASE 300    : PRINT #1, PREFIX_CHAR$ & "Effect Weight: " & SPACE_CHAR$ & "Light" & NEWLINE$
  2287.             CASE 400    : PRINT #1, PREFIX_CHAR$ & "Effect Weight: " & SPACE_CHAR$ & "Normal, Regular" & NEWLINE$
  2288.             CASE 500    : PRINT #1, PREFIX_CHAR$ & "Effect Weight: " & SPACE_CHAR$ & "Medium" & NEWLINE$
  2289.             CASE 600    : PRINT #1, PREFIX_CHAR$ & "Effect Weight: " & SPACE_CHAR$ & "Semi Bold, Demi Bold" & NEWLINE$
  2290.             CASE 700    : PRINT #1, PREFIX_CHAR$ & "Effect Weight: " & SPACE_CHAR$ & "Bold" & NEWLINE$
  2291.             CASE 800    : PRINT #1, PREFIX_CHAR$ & "Effect Weight: " & SPACE_CHAR$ & "Extra Bold, Ultra Bold" & NEWLINE$
  2292.             CASE 900    : PRINT #1, PREFIX_CHAR$ & "Effect Weight: " & SPACE_CHAR$ & "Black, Heavy" & NEWLINE$
  2293.             CASE ELSE    : PRINT #1, PREFIX_CHAR$ & "Effect Weight: " & SPACE_CHAR$ & "Unknown" & NEWLINE$
  2294.         END SELECT
  2295.         IF bEffectItalic = -1 THEN     'temp fix for Booleans; replace -1 with TRUE when fixed
  2296.             PRINT #1, PREFIX_CHAR$ & "Italic: " & SPACE_CHAR$ & "ON" & NEWLINE$
  2297.         ELSE
  2298.             PRINT #1, PREFIX_CHAR$ & "Italic: " & SPACE_CHAR$ & "OFF" & NEWLINE$
  2299.         ENDIF
  2300.         SELECT CASE EffectUnderline&
  2301.             CASE 0    : PRINT #1, PREFIX_CHAR$ & "Underline: " & SPACE_CHAR$ & "None" & NEWLINE$
  2302.             CASE 1    : PRINT #1, PREFIX_CHAR$ & "Underline: " & SPACE_CHAR$ & "Single" & NEWLINE$
  2303.             CASE 2    : PRINT #1, PREFIX_CHAR$ & "Underline: " & SPACE_CHAR$ & "Double" & NEWLINE$
  2304.             CASE 3    : PRINT #1, PREFIX_CHAR$ & "Underline: " & SPACE_CHAR$ & "Word underline" & NEWLINE$
  2305.             CASE ELSE    : PRINT #1, PREFIX_CHAR$ & "Underline: " & SPACE_CHAR$ & "Unknown" & NEWLINE$
  2306.         END SELECT
  2307.         IF bEffectStrike = -1 THEN     'temp fix for Booleans; replace -1 with TRUE when fixed
  2308.             PRINT #1, PREFIX_CHAR$ & "Strike Thru: " & SPACE_CHAR$ & "ON" & NEWLINE$
  2309.         ELSE
  2310.             PRINT #1, PREFIX_CHAR$ & "Strike Thru: " & SPACE_CHAR$ & "OFF" & NEWLINE$
  2311.         ENDIF
  2312.         IF bEffectOverscore = -1 THEN     'temp fix for Booleans; replace -1 with TRUE when fixed
  2313.             PRINT #1, PREFIX_CHAR$ & "Overscore: " & SPACE_CHAR$ & "ON" & NEWLINE$
  2314.         ELSE
  2315.             PRINT #1, PREFIX_CHAR$ & "Overscore: " & SPACE_CHAR$ & "OFF" & NEWLINE$
  2316.         ENDIF
  2317.     END WITHOBJECT
  2318. END SUB
  2319.  
  2320.  
  2321.  
  2322. ' **************************************************************************************
  2323. ' GetEffectColorInfo
  2324. ' This subroutine obtains the Effect color attributes for the active paragraph tag
  2325. ' **************************************************************************************
  2326. SUB GetEffectColorInfo(EffectBackGround AS BOOLEAN)
  2327. REM DIM EffectBackGround AS BOOLEAN
  2328. DIM ECOverprint AS BOOLEAN
  2329.     WITHOBJECT OBJECT_VENTURA8
  2330.         .FormatParaEffectColorGet EffectBackGround, ColorModel&, Colour1&, Colour2&, Colour3&, Colour4&, ECOverprint
  2331.         IF EffectBackGround = -1 THEN     'temp fix for Booleans; replace -1 with TRUE when fixed
  2332.             PRINT #1, DIALOG_PREFIX$ & "Paragraph Properties : Effect Background Color" & NEWLINE$
  2333. '            PRINT #1, PREFIX_CHAR$ & "Background: " & SPACE_CHAR$ & "ON" & NEWLINE$
  2334.         ELSE
  2335.             PRINT #1, DIALOG_PREFIX$ & "Paragraph Properties : Effect Font Color" & NEWLINE$
  2336. '            PRINT #1, PREFIX_CHAR$ & "Background: " & SPACE_CHAR$ & "OFF" & NEWLINE$
  2337.         ENDIF
  2338.         SELECT CASE ColorModel&
  2339.             CASE 2    : PRINT #1, PREFIX_CHAR$ & "Color Model: " & SPACE_CHAR$ & "CMYK" & NEWLINE$
  2340.             CASE 3    : PRINT #1, PREFIX_CHAR$ & "Color Model: " & SPACE_CHAR$ & "CMYK255" & NEWLINE$
  2341.             CASE 4    : PRINT #1, PREFIX_CHAR$ & "Color Model: " & SPACE_CHAR$ & "CMY" & NEWLINE$
  2342.             CASE 5    : PRINT #1, PREFIX_CHAR$ & "Color Model: " & SPACE_CHAR$ & "RGB" & NEWLINE$
  2343.             CASE 6    : PRINT #1, PREFIX_CHAR$ & "Color Model: " & SPACE_CHAR$ & "HSB" & NEWLINE$
  2344.             CASE 7    : PRINT #1, PREFIX_CHAR$ & "Color Model: " & SPACE_CHAR$ & "HLS" & NEWLINE$
  2345.             CASE 9    : PRINT #1, PREFIX_CHAR$ & "Color Model: " & SPACE_CHAR$ & "Grayscale" & NEWLINE$
  2346.             CASE 11    : PRINT #1, PREFIX_CHAR$ & "Color Model: " & SPACE_CHAR$ & "YIQ" & NEWLINE$
  2347.             CASE 12    : PRINT #1, PREFIX_CHAR$ & "Color Model: " & SPACE_CHAR$ & "L*a*b*" & NEWLINE$
  2348.             CASE 13    : PRINT #1, PREFIX_CHAR$ & "Color Model: " & SPACE_CHAR$ & "Registration Color" & NEWLINE$
  2349.             CASE ELSE    : PRINT #1, PREFIX_CHAR$ & "Color Model: " & SPACE_CHAR$ & "Unavailable" & NEWLINE$
  2350.                       ColorModel& = 0 : Colour1& = 0 : Colour2& = 0 : Colour3& = 0 : Colour4& = 0
  2351.         END SELECT
  2352.         PRINT #1, PREFIX_CHAR$ & "Color 1: " & SPACE_CHAR$ & (Colour1&) & NEWLINE$
  2353.         PRINT #1, PREFIX_CHAR$ & "Color 2: " & SPACE_CHAR$ & (Colour2&) & NEWLINE$
  2354.         PRINT #1, PREFIX_CHAR$ & "Color 3: " & SPACE_CHAR$ & (Colour3&) & NEWLINE$
  2355.         PRINT #1, PREFIX_CHAR$ & "Color 4: " & SPACE_CHAR$ & (Colour4&) & NEWLINE$
  2356.         IF ECOverprint = -1 THEN     'temp fix for Booleans; replace -1 with TRUE when fixed
  2357.             PRINT #1, PREFIX_CHAR$ & "Overprint: " & SPACE_CHAR$ & "ON" & NEWLINE$
  2358.         ELSE
  2359.             PRINT #1, PREFIX_CHAR$ & "Overprint: " & SPACE_CHAR$ & "OFF" & NEWLINE$
  2360.         ENDIF
  2361.     END WITHOBJECT
  2362. END SUB
  2363.  
  2364.     
  2365.     
  2366. ' **************************************************************************************
  2367. ' GetParaAlignmentInfo
  2368. ' This subroutine obtains the paragraph alignment attributes for the active paragraph tag
  2369. ' **************************************************************************************
  2370. SUB GetParaAlignmentInfo    
  2371. DIM FrameWideText As BOOLEAN            
  2372. DIM AddPrev AS BOOLEAN                
  2373.     WITHOBJECT OBJECT_VENTURA8
  2374.         .FormatParaAlignmentGet Hor&, Vert&, FrameWideText, RPFromLeft&, RPFromRight&, LPFromLeft&, LPFromRight&, LinesToIndent&, FirstLinesIndent&, AddPrev, DecFromRight&, DecimalChar&, AbsoluteYPosition&
  2375.         PRINT #1, DIALOG_PREFIX$ & "Paragraph Properties : Alignment" & NEWLINE$
  2376.         SELECT CASE Hor&
  2377.             CASE 0    : PRINT #1, PREFIX_CHAR$ & "Horizontal: " & SPACE_CHAR$ & "Left" & NEWLINE$
  2378.             CASE 1    : PRINT #1, PREFIX_CHAR$ & "Horizontal: " & SPACE_CHAR$ & "Center" & NEWLINE$
  2379.             CASE 2    : PRINT #1, PREFIX_CHAR$ & "Horizontal: " & SPACE_CHAR$ & "Right" & NEWLINE$
  2380.             CASE 3    : PRINT #1, PREFIX_CHAR$ & "Horizontal: " & SPACE_CHAR$ & "Decimal" & NEWLINE$
  2381.             CASE 4    : PRINT #1, PREFIX_CHAR$ & "Horizontal: " & SPACE_CHAR$ & "Justified" & NEWLINE$
  2382.             CASE 5    : PRINT #1, PREFIX_CHAR$ & "Horizontal: " & SPACE_CHAR$ & "Force justified" & NEWLINE$
  2383.             CASE ELSE    : PRINT #1, PREFIX_CHAR$ & "Horizontal: " & SPACE_CHAR$ & "Unknown" & NEWLINE$
  2384.         END SELECT
  2385.         SELECT CASE Vert&
  2386.             CASE 0    : PRINT #1, PREFIX_CHAR$ & "Vertical: " & SPACE_CHAR$ & "Top" & NEWLINE$
  2387.             CASE 1    : PRINT #1, PREFIX_CHAR$ & "Vertical: " & SPACE_CHAR$ & "Middle" & NEWLINE$
  2388.             CASE 2    : PRINT #1, PREFIX_CHAR$ & "Vertical: " & SPACE_CHAR$ & "Bottom" & NEWLINE$
  2389.             CASE 3    : PRINT #1, PREFIX_CHAR$ & "Vertical: " & SPACE_CHAR$ & "Absolute" & NEWLINE$
  2390.             CASE ELSE    : PRINT #1, PREFIX_CHAR$ & "Vertical: " & SPACE_CHAR$ & "Unknown" & NEWLINE$
  2391.         END SELECT
  2392.  
  2393. REM         IF FrameWideText = -1 THEN     'temp fix for Booleans; replace -1 with TRUE when fixed
  2394. REM             PRINT #1, PREFIX_CHAR$ & "Frame Wide Text: " & SPACE_CHAR$ & "ON" & NEWLINE$
  2395. REM         ELSE
  2396. REM             PRINT #1, PREFIX_CHAR$ & "Frame Wide Text: " & SPACE_CHAR$ & "OFF" & NEWLINE$
  2397. REM         ENDIF
  2398.         DBLRPFromLeft# = CDBL(RPFromLeft&)
  2399.         ConvertTo HorizontalUnits&, DBLRPFromLeft#
  2400.         PRINT #1, PREFIX_CHAR$ & "Right Page In From Left: " & SPACE_CHAR$ &  DBLRPFromLeft# & UNITS_PREFIX$ & Units$(HorizontalUnits&) & NEWLINE$
  2401.  
  2402.         DBLRPFromRight# = CDBL(RPFromRight&)
  2403.         ConvertTo HorizontalUnits&, DBLRPFromRight#
  2404.         PRINT #1, PREFIX_CHAR$ & "Right Page In From Right: " & SPACE_CHAR$ &  DBLRPFromRight# & UNITS_PREFIX$ & Units$(HorizontalUnits&) & NEWLINE$
  2405.  
  2406.         DBLLPFromLeft# = CDBL(LPFromLeft&)
  2407.         ConvertTo HorizontalUnits&, DBLLPFromLeft#
  2408.         PRINT #1, PREFIX_CHAR$ & "Left Page In From Left: " & SPACE_CHAR$ &  DBLLPFromLeft# & UNITS_PREFIX$ & Units$(HorizontalUnits&) & NEWLINE$
  2409.  
  2410.         DBLLPFromRight# = CDBL(LPFromRight&)
  2411.         ConvertTo HorizontalUnits&, DBLLPFromRight#
  2412.         PRINT #1, PREFIX_CHAR$ & "Left Page In From Right: " & SPACE_CHAR$ &  DBLLPFromRight# & UNITS_PREFIX$ & Units$(HorizontalUnits&) & NEWLINE$
  2413.  
  2414.         PRINT #1, PREFIX_CHAR$ & "Lines To Indent: " & SPACE_CHAR$ & LinesToIndent& & NEWLINE$
  2415.  
  2416.         DBLFirstLinesIndent# = CDBL(FirstLinesIndent&)
  2417.         ConvertTo HorizontalUnits&, DBLFirstLinesIndent#
  2418.         PRINT #1, PREFIX_CHAR$ & "Lines Indent Amount: " & SPACE_CHAR$ & DBLFirstLinesIndent# & UNITS_PREFIX$ & Units$(HorizontalUnits&) & NEWLINE$
  2419.  
  2420.         IF AddPrev = -1 THEN     'temp fix for Booleans; replace -1 with TRUE when fixed
  2421.             PRINT #1, PREFIX_CHAR$ & "Add Width of Preceding Line: " & SPACE_CHAR$ & "ON" & NEWLINE$
  2422.         ELSE
  2423.             PRINT #1, PREFIX_CHAR$ & "Add Width of Preceding Line: " & SPACE_CHAR$ & "OFF" & NEWLINE$
  2424.         ENDIF
  2425.  
  2426.         DBLDecFromRight# = CDBL(DecFromRight&)
  2427.         ConvertTo HorizontalUnits&, DBLDecFromRight#
  2428.         PRINT #1, PREFIX_CHAR$ & "Decimal From Right: " & SPACE_CHAR$ &  DBLDecFromRight# & UNITS_PREFIX$ & Units$(HorizontalUnits&) & NEWLINE$
  2429.  
  2430.         PRINT #1, PREFIX_CHAR$ & "Decimal Character: " & SPACE_CHAR$ &  (DecimalChar&)  & UNITS_PREFIX$ & "ANSI" & NEWLINE$
  2431.     END WITHOBJECT
  2432. END SUB
  2433.  
  2434.  
  2435. ' **************************************************************************************
  2436. ' GetParaSpacingInfo
  2437. ' This subroutine obtains the paragraph spacing attributes for the active paragraph tag
  2438. ' **************************************************************************************
  2439. SUB GetParaSpacingInfo
  2440. DIM GrowInterline AS BOOLEAN
  2441. DIM AddAbove AS BOOLEAN
  2442. DIM AddAboveOnly AS BOOLEAN
  2443.     WITHOBJECT OBJECT_VENTURA8
  2444.         .FormatParaSpacingGet SpaceAfter&, SpaceBefore&, SpaceInterLine&, SpaceInterPara&, AASpace&, GrowInterline, AddAbove, AddAboveOnly, RotationAngle&, RotationHeight&
  2445.         PRINT #1, DIALOG_PREFIX$ & "Paragraph Properties : Spacing" & NEWLINE$
  2446.  
  2447.         DBLSpaceAfter# = CDBL(SpaceAfter&)
  2448.         ConvertTo VerticalUnits&, DBLSpaceAfter#
  2449.         PRINT #1, PREFIX_CHAR$ & "Space Above: " & SPACE_CHAR$ & DBLSpaceAfter# & UNITS_PREFIX$ & Units$(VerticalUnits&) & NEWLINE$
  2450.  
  2451.         DBLSpaceBefore# = CDBL(SpaceBefore&)
  2452.         ConvertTo VerticalUnits&, DBLSpaceBefore#
  2453.         PRINT #1, PREFIX_CHAR$ & "Space Below: " & SPACE_CHAR$ & DBLSpaceBefore# & UNITS_PREFIX$ & Units$(VerticalUnits&) & NEWLINE$
  2454.  
  2455.         DBLSpaceInterLine# = CDBL(SpaceInterLine&)
  2456.         ConvertTo VerticalUnits&, DBLSpaceInterLine#
  2457.         PRINT #1, PREFIX_CHAR$ & "Inter-line: " & SPACE_CHAR$ & DBLSpaceInterLine# & UNITS_PREFIX$ & Units$(VerticalUnits&) & NEWLINE$
  2458.  
  2459.         DBLSpaceInterPara# = CDBL(SpaceInterPara&)
  2460.         ConvertTo VerticalUnits&, DBLSpaceInterPara#
  2461.         PRINT #1, PREFIX_CHAR$ & "Inter-paragraph: " & SPACE_CHAR$ & DBLSpaceInterPara# & UNITS_PREFIX$ & Units$(VerticalUnits&) & NEWLINE$
  2462.  
  2463.         SELECT CASE AASpace&
  2464.             CASE 1    : PRINT #1, PREFIX_CHAR$ & "Auto Adjust: " & SPACE_CHAR$ & "Percentage" & NEWLINE$
  2465.             CASE 2    : PRINT #1, PREFIX_CHAR$ & "Auto Adjust: " & SPACE_CHAR$ & "Add" & NEWLINE$
  2466.             CASE 4    : PRINT #1, PREFIX_CHAR$ & "Auto Adjust: " & SPACE_CHAR$ & "None" & NEWLINE$
  2467.             CASE ELSE    : PRINT #1, PREFIX_CHAR$ & "Auto Adjust: " & SPACE_CHAR$ & "Unknown" & NEWLINE$
  2468.         END SELECT
  2469.         IF GrowInterline = -1 THEN     'temp fix for Booleans; replace -1 with TRUE when fixed
  2470.             PRINT #1, PREFIX_CHAR$ & "Grow Interline: " & SPACE_CHAR$ & "ON" & NEWLINE$
  2471.         ELSE
  2472.             PRINT #1, PREFIX_CHAR$ & "Grow Interline: " & SPACE_CHAR$ & "OFF" & NEWLINE$
  2473.         ENDIF
  2474.         IF AddAbove = -1 THEN     'temp fix for Booleans; replace -1 with TRUE when fixed
  2475.             PRINT #1, PREFIX_CHAR$ & "Add Above: " & SPACE_CHAR$ & "ON" & NEWLINE$
  2476.         ELSE
  2477.             PRINT #1, PREFIX_CHAR$ & "Add Above: " & SPACE_CHAR$ & "OFF" & NEWLINE$
  2478.         ENDIF
  2479.         IF AddAboveOnly = -1 THEN     'temp fix for Booleans; replace -1 with TRUE when fixed
  2480.             PRINT #1, PREFIX_CHAR$ & "Add Above Space Only: " & SPACE_CHAR$ & "ON" & NEWLINE$
  2481.         ELSE
  2482.             PRINT #1, PREFIX_CHAR$ & "Add Above Space Only: " & SPACE_CHAR$ & "OFF" & NEWLINE$
  2483.         ENDIF
  2484.  
  2485.         PRINT #1, PREFIX_CHAR$ & "Rotation Angle: " & SPACE_CHAR$ & (RotationAngle&/10) & UNITS_PREFIX$ & "%" & NEWLINE$
  2486.         DBLRotationHeight# = CDBL(RotationHeight&)
  2487.         ConvertTo VerticalUnits&, DBLRotationHeight#
  2488.         PRINT #1, PREFIX_CHAR$ & "Max Height: " & SPACE_CHAR$ & DBLRotationHeight# & UNITS_PREFIX$ & Units$(VerticalUnits&) & NEWLINE$
  2489.     END WITHOBJECT
  2490. END SUB
  2491.  
  2492.  
  2493. ' **************************************************************************************
  2494. ' GetParaTabInfo
  2495. ' This subroutine obtains the paragraph alignment attributes for the active paragraph tag
  2496. ' **************************************************************************************
  2497. SUB GetParaTabInfo
  2498. DIM Leader AS BOOLEAN
  2499.     WITHOBJECT OBJECT_VENTURA8
  2500.         PRINT #1, DIALOG_PREFIX$ & "Paragraph Properties : Tabs" & NEWLINE$
  2501.  
  2502.         TabCount& = .FormatParaTabCount()
  2503.         IF SelectedApp& = PUBLISH_TO_VENTURA OR SelectedApp& = PUBLISH_TO_TEXT THEN 
  2504.             IF TabCount& > 0 THEN 
  2505.                 FOR Position& = 1 TO TabCount&
  2506.                     .FormatParaTabGetAt Position&, Location!, Align&, Leader, LeaderChar&, LeaderSpacing&
  2507.                     DBLLocation# = CDBL(Location!)
  2508.                     ConvertTo HorizontalUnits&, FROMINCHES(DBLLocation#)
  2509.                     Round DBLLocation#, .010
  2510.                     PRINT #1, PREFIX_CHAR$ & "Tab " & Position& & " Location: " & SPACE_CHAR$ & DBLLocation# & UNITS_PREFIX$ & Units$(HorizontalUnits&) & NEWLINE$
  2511.                     SELECT CASE Align&
  2512.                         CASE 0    : PRINT #1, PREFIX_CHAR$ & "Tab " & Position& & " Alignment: " & SPACE_CHAR$ & "Left" & NEWLINE$
  2513.                         CASE 1    : PRINT #1, PREFIX_CHAR$ & "Tab " & Position& & " Alignment: " & SPACE_CHAR$ & "Right" & NEWLINE$
  2514.                         CASE 2    : PRINT #1, PREFIX_CHAR$ & "Tab " & Position& & " Alignment: " & SPACE_CHAR$ & "Decimal" & NEWLINE$
  2515.                         CASE 3    : PRINT #1, PREFIX_CHAR$ & "Tab " & Position& & " Alignment: " & SPACE_CHAR$ & "Center" & NEWLINE$
  2516.                         CASE ELSE    : PRINT #1, PREFIX_CHAR$ & "Tab " & Position& & " Alignment: " & SPACE_CHAR$ & "" & NEWLINE$
  2517.                     END SELECT
  2518.                     PRINT #1, PREFIX_CHAR$ & "Tab " & Position& & " Leader: " & SPACE_CHAR$ & (Leader) & NEWLINE$
  2519.                     PRINT #1, PREFIX_CHAR$ & "Tab " & Position& & " Leader Character: " & SPACE_CHAR$ & (LeaderChar&) & UNITS_PREFIX$ & "ANSI" & NEWLINE$
  2520.                     PRINT #1, PREFIX_CHAR$ & "Tab " & Position& & " Leader Spacing: " & SPACE_CHAR$ & (LeaderSpacing&) & NEWLINE$
  2521.                 NEXT Position&
  2522.             ELSE
  2523.                 Position& = 0 : SETEMPTY Location! : Align&=-1 : SETEMPTY Leader : SETEMPTY LeaderChar& : SETEMPTY LeaderSpacing&
  2524.                 PRINT #1, PREFIX_CHAR$ & "No tabs set" & NEWLINE$
  2525.             ENDIF
  2526.     
  2527.         ELSE
  2528.             IF TabCount& > 0 THEN 
  2529.                 'get position parameter for all tabs
  2530.                 FOR Position& = 1 TO TabCount&
  2531.                     .FormatParaTabGetAt Position&, Location!, Align&, Leader, LeaderChar&, LeaderSpacing&
  2532.                     PositionStr$ = PositionStr$ & STR(Position&) & ", "
  2533.                 NEXT Position&
  2534.                 PositionStr$ = MID(PositionStr$, 1, LEN(PositionStr$)-2)
  2535.                 'get location parameter for all tabs
  2536.                 FOR Position& = 1 TO TabCount&
  2537.                     .FormatParaTabGetAt Position&, Location!, Align&, Leader, LeaderChar&, LeaderSpacing&
  2538.                     DBLLocation# = CDBL(Location!)
  2539.                     ConvertTo HorizontalUnits&, FROMINCHES(DBLLocation#)
  2540.                     LocationStr$ = LocationStr$ & STR(DBLLocation#) & ", "
  2541.                 NEXT Position&
  2542.                 LocationStr$ = MID(LocationStr$, 1, LEN(LocationStr$)-2) & UNITS_PREFIX$ & Units$(HorizontalUnits&) 
  2543.                 'get alignment parameter for all tabs
  2544.                 FOR Position& = 1 TO TabCount&
  2545.                     .FormatParaTabGetAt Position&, Location!, Align&, Leader, LeaderChar&, LeaderSpacing&
  2546.                     SELECT CASE Align&
  2547.                         CASE 0    : Alignment$ = "Left" 
  2548.                         CASE 1    : Alignment$ = "Right" 
  2549.                         CASE 2    : Alignment$ = "Decimal"
  2550.                         CASE 3    : Alignment$ = "Center"
  2551.                         CASE ELSE    : Alignment$ = "" 
  2552.                     END SELECT
  2553.                     AlignmentStr$ = AlignmentStr$ & Alignment$ & ", "
  2554.                 NEXT Position&    
  2555.                 AlignmentStr$ = MID(AlignmentStr$, 1, LEN(AlignmentStr$)-2)
  2556.                 'get Leader parameter for all tabs
  2557.                 FOR Position& = 1 TO TabCount&
  2558.                     .FormatParaTabGetAt Position&, Location!, Align&, Leader, LeaderChar&, LeaderSpacing&
  2559. REM                     IF Leader = TRUE THEN 
  2560. REM                         LeaderStr$ = LeaderStr$ & "ON" & ", "
  2561. REM                     ELSE
  2562. REM                         LeaderStr$ = LeaderStr$ & "OFF" & ", "
  2563. REM                     ENDIF
  2564.                     LeaderStr$ = LeaderStr$ & Leader & ", "
  2565.                 NEXT Position&    
  2566.                 LeaderStr$ = MID(LeaderStr$, 1, LEN(LeaderStr$)-2)
  2567.                 'get LeaderChar parameter for all tabs
  2568.                 FOR Position& = 1 TO TabCount&
  2569.                     .FormatParaTabGetAt Position&, Location!, Align&, Leader, LeaderChar&, LeaderSpacing&
  2570.                     LeaderCharStr$ = LeaderCharStr$ & STR(LeaderChar) & ", "
  2571.                 NEXT Position&
  2572.                 LeaderCharStr$ = MID(LeaderCharStr$, 1, LEN(LeaderCharStr$)-2) & UNITS_PREFIX$ & "ANSI" 
  2573.                 'get LeaderSpacing parameter for all tabs
  2574.                 FOR Position& = 1 TO TabCount&
  2575.                     .FormatParaTabGetAt Position&, Location!, Align&, Leader, LeaderChar&, LeaderSpacing&
  2576.                     LeaderSpacingStr$ = LeaderSpacingStr$ & STR(LeaderSpacing&) & ", "
  2577.                 NEXT Position&
  2578.                 LeaderSpacingStr$ = MID(LeaderSpacingStr$, 1, LEN(LeaderSpacingStr$)-2)
  2579.             ELSE
  2580.                 Position& = 0 : SETEMPTY LocationStr$ : SETEMPTY AlignmentStr$ : SETEMPTY LeaderStr$ : SETEMPTY LeaderCharStr$ : SETEMPTY LeaderSpacingStr$
  2581.                 PositionStr$ = "No tabs set"    
  2582.             ENDIF
  2583.             PRINT #1, PREFIX_CHAR$ & "Position: " & SPACE_CHAR$ & PositionStr$ & NEWLINE$
  2584.             PRINT #1, PREFIX_CHAR$ & "Location: " & SPACE_CHAR$ & LocationStr$ &  NEWLINE$
  2585.             PRINT #1, PREFIX_CHAR$ & "Alignment: " & SPACE_CHAR$ & AlignmentStr$ & NEWLINE$
  2586.             PRINT #1, PREFIX_CHAR$ & "Leader: " & SPACE_CHAR$ & LeaderStr$ & NEWLINE$
  2587.             PRINT #1, PREFIX_CHAR$ & "Leader Character: " & SPACE_CHAR$ & LeaderCharStr$ &  NEWLINE$
  2588.             PRINT #1, PREFIX_CHAR$ & "Leader Spacing: " & SPACE_CHAR$ & LeaderSpacingStr$ & NEWLINE$
  2589.             SETEMPTY PositionStr$ : SETEMPTY LocationStr$ : SETEMPTY AlignmentStr$ : SETEMPTY LeaderStr$ : SETEMPTY LeaderCharStr$ : SETEMPTY LeaderSpacingStr$
  2590.         ENDIF
  2591.     END WITHOBJECT
  2592. END SUB
  2593.  
  2594.  
  2595. ' **************************************************************************************
  2596. ' GetParaBreaksInfo
  2597. ' This subroutine obtains the paragraph break attributes for the active paragraph tag
  2598. ' **************************************************************************************
  2599. SUB GetParaBreaksInfo
  2600. DIM InLineWithPrev AS BOOLEAN        
  2601. DIM AllowBreakWithin AS BOOLEAN
  2602. DIM KeepWithNext AS BOOLEAN
  2603. DIM KeepWithPrev AS BOOLEAN
  2604. DIM FrameWideText As BOOLEAN            
  2605.  
  2606.     WITHOBJECT OBJECT_VENTURA8
  2607.         .FormatParaBreaksGet PageBreak&, ColumnBreak&, LineBreak&, InLineWithPrev, AllowBreakWithin, KeepWithNext, KeepWithPrev
  2608.         PRINT #1, DIALOG_PREFIX$ & "Paragraph Properties : Breaks" & NEWLINE$
  2609.         SELECT CASE PageBreak&
  2610.             CASE 0    : PRINT #1, PREFIX_CHAR$ & "Page Break: " & SPACE_CHAR$ & "None" & NEWLINE$
  2611.             CASE 1    : PRINT #1, PREFIX_CHAR$ & "Page Break: " & SPACE_CHAR$ & "Before" & NEWLINE$
  2612.             CASE 2    : PRINT #1, PREFIX_CHAR$ & "Page Break: " & SPACE_CHAR$ & "After" & NEWLINE$
  2613.             CASE 3    : PRINT #1, PREFIX_CHAR$ & "Page Break: " & SPACE_CHAR$ & "Before & After" & NEWLINE$
  2614.             CASE 4    : PRINT #1, PREFIX_CHAR$ & "Page Break: " & SPACE_CHAR$ & "Before/Until Left" & NEWLINE$
  2615.             CASE 5    : PRINT #1, PREFIX_CHAR$ & "Page Break: " & SPACE_CHAR$ & "Before/Until Right" & NEWLINE$
  2616.             CASE ELSE    : PRINT #1, PREFIX_CHAR$ & "Page Break: " & SPACE_CHAR$ & "Unknown" & NEWLINE$
  2617.         END SELECT
  2618.         SELECT CASE ColumnBreak&
  2619.             CASE 0    : PRINT #1, PREFIX_CHAR$ & "Column Break: " & SPACE_CHAR$ & "None" & NEWLINE$
  2620.             CASE 1    : PRINT #1, PREFIX_CHAR$ & "Column Break: " & SPACE_CHAR$ & "Before" & NEWLINE$
  2621.             CASE 2    : PRINT #1, PREFIX_CHAR$ & "Column Break: " & SPACE_CHAR$ & "After" & NEWLINE$
  2622.             CASE 3    : PRINT #1, PREFIX_CHAR$ & "Column Break: " & SPACE_CHAR$ & "Before & After" & NEWLINE$
  2623.             CASE ELSE    : PRINT #1, PREFIX_CHAR$ & "Column Break: " & SPACE_CHAR$ & "Unknown" & NEWLINE$
  2624.         END SELECT
  2625.  
  2626.         SELECT CASE LineBreak&
  2627.             CASE 0    : PRINT #1, PREFIX_CHAR$ & "Line Break: " & SPACE_CHAR$ & "None" & NEWLINE$
  2628.             CASE 1    : PRINT #1, PREFIX_CHAR$ & "Line Break: " & SPACE_CHAR$ & "Before" & NEWLINE$
  2629.             CASE 2    : PRINT #1, PREFIX_CHAR$ & "Line Break: " & SPACE_CHAR$ & "After" & NEWLINE$
  2630.             CASE 3    : PRINT #1, PREFIX_CHAR$ & "Line Break: " & SPACE_CHAR$ & "Before & After" & NEWLINE$
  2631.             CASE ELSE    : PRINT #1, PREFIX_CHAR$ & "Line Break: " & SPACE_CHAR$ & "Unknown" & NEWLINE$
  2632.         END SELECT
  2633.  
  2634.         IF InLineWithPrev = -1 THEN     'temp fix for Booleans; replace -1 with TRUE when fixed
  2635.             PRINT #1, PREFIX_CHAR$ & "In Line With Previous: " & SPACE_CHAR$ & "ON" & NEWLINE$
  2636.         ELSE
  2637.             PRINT #1, PREFIX_CHAR$ & "In Line With Previous: " & SPACE_CHAR$ & "OFF" & NEWLINE$
  2638.         ENDIF
  2639.         IF AllowBreakWithin = -1 THEN     'temp fix for Booleans; replace -1 with TRUE when fixed
  2640.             PRINT #1, PREFIX_CHAR$ & "AllowBreakWithin: " & SPACE_CHAR$ & "ON" & NEWLINE$
  2641.         ELSE
  2642.             PRINT #1, PREFIX_CHAR$ & "AllowBreakWithin: " & SPACE_CHAR$ & "OFF" & NEWLINE$
  2643.         ENDIF
  2644.         IF KeepWithNext = -1 THEN     'temp fix for Booleans; replace -1 with TRUE when fixed
  2645.             PRINT #1, PREFIX_CHAR$ & "Keep With Next: " & SPACE_CHAR$ & "ON" & NEWLINE$
  2646.         ELSE
  2647.             PRINT #1, PREFIX_CHAR$ & "Keep With Next: " & SPACE_CHAR$ & "OFF" & NEWLINE$
  2648.         ENDIF
  2649.         IF KeepWithPrev = -1 THEN     'temp fix for Booleans; replace -1 with TRUE when fixed
  2650.             PRINT #1, PREFIX_CHAR$ & "Keep With Previous: " & SPACE_CHAR$ & "ON" & NEWLINE$
  2651.         ELSE
  2652.             PRINT #1, PREFIX_CHAR$ & "Keep With Previous: " & SPACE_CHAR$ & "OFF" & NEWLINE$
  2653.         ENDIF
  2654.  
  2655.         'Columns to apan now appears with the Breaks properties
  2656.         .FormatParaDefaultsGet AADefault, ColsToSpan&, NextTag$    ', OverscoreThick&, OverscoreShift&, StrikeThick&, StrikeShift&, ULine1Thick&, ULine1Shift&, ULine2Thick&, ULine2Shift&, SuperscriptPS!, SuperscriptShift&, SubscriptPS!, SubscriptShift&, Tracking&, TrackAmount&
  2657.         PRINT #1, PREFIX_CHAR$ & "Next Tag: " & SPACE_CHAR$ & NextTag$ & NEWLINE$
  2658.  
  2659.         'Frame-wide text parameter now appears with the Breaks properties
  2660.         .FormatParaAlignmentGet Hor&, Vert&, FrameWideText    ', RPFromLeft&, RPFromRight&, LPFromLeft&, LPFromRight&, LinesToIndent&, FirstLinesIndent&, AddPrev, DecFromRight&, DecimalChar&, AbsoluteYPosition&
  2661.  
  2662.         IF FrameWideText = -1 THEN     'temp fix for Booleans; replace -1 with TRUE when fixed
  2663.             PRINT #1, PREFIX_CHAR$ & "Frame Wide Text: " & SPACE_CHAR$ & "ON" & NEWLINE$
  2664.         ELSE
  2665.             PRINT #1, PREFIX_CHAR$ & "Frame Wide Text: " & SPACE_CHAR$ & "OFF" & NEWLINE$
  2666.         ENDIF
  2667.         PRINT #1, PREFIX_CHAR$ & "Columns To Span: " & SPACE_CHAR$ & (ColsToSpan&) & NEWLINE$
  2668.  
  2669.     END WITHOBJECT
  2670. END SUB
  2671.  
  2672.  
  2673. ' **************************************************************************************
  2674. ' GetParaHyphenationInfo
  2675. ' This subroutine obtains the paragraph hyphenation attributes for the active paragraph tag
  2676. ' **************************************************************************************
  2677. SUB GetParaHyphenationInfo
  2678. DIM Automatic AS BOOLEAN
  2679. DIM AtPageEnd AS BOOLEAN
  2680. DIM AtLastWord AS BOOLEAN
  2681. DIM ForCapital AS BOOLEAN
  2682.     WITHOBJECT OBJECT_VENTURA8
  2683.         .FormatParaHyphenationGet Automatic, Dict$, SuccessiveHyphs&, MinWordSize&, MinCharsBefore&, MinCharsAfter&, AtPageEnd, AtLastWord, ForCapital
  2684.         PRINT #1, DIALOG_PREFIX$ & "Paragraph Properties : Hyphens" & NEWLINE$
  2685.         IF Automatic = -1 THEN     'temp fix for Booleans; replace -1 with TRUE when fixed
  2686.             PRINT #1, PREFIX_CHAR$ & "Automatic: " & SPACE_CHAR$ & "ON" & NEWLINE$
  2687.         ELSE
  2688.             PRINT #1, PREFIX_CHAR$ & "Automatic: " & SPACE_CHAR$ & "OFF" & NEWLINE$
  2689.         ENDIF
  2690.         PRINT #1, PREFIX_CHAR$ & "Dictionary: " & SPACE_CHAR$ & Dict$ & NEWLINE$
  2691.         PRINT #1, PREFIX_CHAR$ & "Successive Hyphens: " & SPACE_CHAR$ & (SuccessiveHyphs&) & NEWLINE$
  2692.         PRINT #1, PREFIX_CHAR$ & "Min Word Size: " & SPACE_CHAR$ & (MinWordSize&) & NEWLINE$
  2693.         PRINT #1, PREFIX_CHAR$ & "Min Characters Before: " & SPACE_CHAR$ & (MinCharsBefore&) & NEWLINE$
  2694.         PRINT #1, PREFIX_CHAR$ & "Min Characters After: " & SPACE_CHAR$ & (MinCharsAfter&) & NEWLINE$
  2695.         IF AtPageEnd = -1 THEN     'temp fix for Booleans; replace -1 with TRUE when fixed
  2696.             PRINT #1, PREFIX_CHAR$ & "At Page End: " & SPACE_CHAR$ & "ON" & NEWLINE$
  2697.         ELSE
  2698.             PRINT #1, PREFIX_CHAR$ & "At Page End: " & SPACE_CHAR$ & "OFF" & NEWLINE$
  2699.         ENDIF
  2700.         IF AtLastWord = -1 THEN     'temp fix for Booleans; replace -1 with TRUE when fixed
  2701.             PRINT #1, PREFIX_CHAR$ & "At Last Word: " & SPACE_CHAR$ & "ON" & NEWLINE$
  2702.         ELSE
  2703.             PRINT #1, PREFIX_CHAR$ & "At Last Word: " & SPACE_CHAR$ & "OFF" & NEWLINE$
  2704.         ENDIF
  2705.         IF ForCapital = -1 THEN     'temp fix for Booleans; replace -1 with TRUE when fixed
  2706.             PRINT #1, PREFIX_CHAR$ & "For Capitalized: " & SPACE_CHAR$ & "ON" & NEWLINE$
  2707.         ELSE
  2708.             PRINT #1, PREFIX_CHAR$ & "For Capitalized: " & SPACE_CHAR$ & "OFF" & NEWLINE$
  2709.         ENDIF
  2710.     END WITHOBJECT
  2711. END SUB
  2712.  
  2713.  
  2714. ' **************************************************************************************
  2715. ' GetParaTypographyInfo
  2716. ' This subroutine obtains the paragraph Typography attributes for the active paragraph tag
  2717. ' **************************************************************************************
  2718. SUB GetParaTypographyInfo
  2719. DIM LetterSpace AS BOOLEAN
  2720. DIM Kerning AS BOOLEAN
  2721.     WITHOBJECT OBJECT_VENTURA8
  2722.         .FormatParaTypographyGet WordSpace&, MinWordSpace&, MaxWordSpace&, LetterSpace, MaxLetterSpace&, VJAbove&, VJBelow&, VJInterline&, Kerning
  2723.         PRINT #1, DIALOG_PREFIX$ & "Paragraph Properties : Typography" & NEWLINE$
  2724.         PRINT #1, PREFIX_CHAR$ & "Word Space: " & SPACE_CHAR$ & (WordSpace&/10) & UNITS_PREFIX$ & "%" & NEWLINE$
  2725.         PRINT #1, PREFIX_CHAR$ & "Min Word Space: " & SPACE_CHAR$ & (MinWordSpace&/10) & UNITS_PREFIX$ & "%" & NEWLINE$
  2726.         PRINT #1, PREFIX_CHAR$ & "Max Word Space: " & SPACE_CHAR$ & (MaxWordSpace&/10) & UNITS_PREFIX$ & "%" & NEWLINE$
  2727.         IF LetterSpace = -1 THEN     'temp fix for Booleans; replace -1 with TRUE when fixed
  2728.             PRINT #1, PREFIX_CHAR$ & "Letter Space: " & SPACE_CHAR$ & "ON" & NEWLINE$
  2729.         ELSE
  2730.             PRINT #1, PREFIX_CHAR$ & "Letter Space: " & SPACE_CHAR$ & "OFF" & NEWLINE$
  2731.         ENDIF
  2732.         PRINT #1, PREFIX_CHAR$ & "Max Letter Space: " & SPACE_CHAR$ & (MaxLetterSpace&/10) & UNITS_PREFIX$ & "%" & NEWLINE$
  2733.         DBLVJAbove# = CDBL(VJAbove&)
  2734.         ConvertTo VerticalUnits&, DBLVJAbove#
  2735.         PRINT #1, PREFIX_CHAR$ & "VJ Above: " & SPACE_CHAR$ & DBLVJAbove# & UNITS_PREFIX$ & Units$(VerticalUnits&) & NEWLINE$
  2736.         DBLVJBelow# = CDBL(VJBelow&)
  2737.         ConvertTo VerticalUnits&, DBLVJBelow#
  2738.         PRINT #1, PREFIX_CHAR$ & "VJ Below: " & SPACE_CHAR$ & DBLVJBelow# & UNITS_PREFIX$ & Units$(VerticalUnits&) & NEWLINE$
  2739.         DBLVJInterline# = CDBL(VJInterline&)
  2740.         ConvertTo VerticalUnits&, DBLVJInterline#
  2741.         PRINT #1, PREFIX_CHAR$ & "VJ Interline: " & SPACE_CHAR$ & DBLVJInterline# & UNITS_PREFIX$ & Units$(VerticalUnits&) & NEWLINE$
  2742.         IF Kerning = -1 THEN     'temp fix for Booleans; replace -1 with TRUE when fixed
  2743.             PRINT #1, PREFIX_CHAR$ & "Kerning: " & SPACE_CHAR$ & "ON" & NEWLINE$
  2744.         ELSE
  2745.             PRINT #1, PREFIX_CHAR$ & "Kerning: " & SPACE_CHAR$ & "OFF" & NEWLINE$
  2746.         ENDIF
  2747.     END WITHOBJECT
  2748. END SUB
  2749.  
  2750.  
  2751. ' **************************************************************************************
  2752. ' GetParaDefaultsInfo
  2753. ' This subroutine obtains the paragraph default attributes for the active paragraph tag
  2754. ' **************************************************************************************
  2755. SUB GetParaDefaultsInfo
  2756. DIM AADefault AS BOOLEAN
  2757.     WITHOBJECT OBJECT_VENTURA8
  2758.         .FormatParaDefaultsGet AADefault, ColsToSpan&, NextTag$, OverscoreThick&, OverscoreShift&, StrikeThick&, StrikeShift&, ULine1Thick&, ULine1Shift&, ULine2Thick&, ULine2Shift&, SuperscriptPS!, SuperscriptShift&, SubscriptPS!, SubscriptShift&, Tracking&, TrackAmount&
  2759.         PRINT #1, DIALOG_PREFIX$ & "Paragraph Properties : Defaults" & NEWLINE$
  2760.         IF AADefault = -1 THEN     'temp fix for Booleans; replace -1 with TRUE when fixed
  2761.             PRINT #1, PREFIX_CHAR$ & "Auto Adjust: " & SPACE_CHAR$ & "ON" & NEWLINE$
  2762.         ELSE
  2763.             PRINT #1, PREFIX_CHAR$ & "Auto Adjust: " & SPACE_CHAR$ & "OFF" & NEWLINE$
  2764.         ENDIF
  2765. REM         PRINT #1, PREFIX_CHAR$ & "Columns To Span: " & SPACE_CHAR$ & (ColsToSpan&) & NEWLINE$
  2766. REM         PRINT #1, PREFIX_CHAR$ & "Next Tag: " & SPACE_CHAR$ & NextTag$ & NEWLINE$
  2767.         DBLOverscoreThick# = CDBL(OverscoreThick&)
  2768.         ConvertTo UnderlineUnits&, DBLOverscoreThick#
  2769.         PRINT #1, PREFIX_CHAR$ & "Overscore Thickness: " & SPACE_CHAR$ & DBLOverscoreThick# & UNITS_PREFIX$ & Units$(UnderlineUnits&) & NEWLINE$
  2770.  
  2771.         DBLOverscoreShift# = CDBL(OverscoreShift&)
  2772.         ConvertTo UnderlineUnits&, DBLOverscoreShift#
  2773.         PRINT #1, PREFIX_CHAR$ & "Overscore Shift: " & SPACE_CHAR$ & DBLOverscoreShift# & UNITS_PREFIX$ & Units$(UnderlineUnits&) & NEWLINE$
  2774.  
  2775.         DBLStrikeThick# = CDBL(StrikeThick&)
  2776.         ConvertTo UnderlineUnits&, DBLStrikeThick#
  2777.         PRINT #1, PREFIX_CHAR$ & "Strike Thickness: " & SPACE_CHAR$ & DBLStrikeThick# & UNITS_PREFIX$ & Units$(UnderlineUnits&) & NEWLINE$
  2778.  
  2779.         DBLStrikeShift# = CDBL(StrikeShift&)
  2780.         ConvertTo UnderlineUnits&, DBLStrikeShift#
  2781.         PRINT #1, PREFIX_CHAR$ & "Strike Shift: " & SPACE_CHAR$ & DBLStrikeShift# & UNITS_PREFIX$ & Units$(UnderlineUnits&) & NEWLINE$
  2782.  
  2783.         DBLULine1Thick# = CDBL(ULine1Thick&)
  2784.         ConvertTo UnderlineUnits&, DBLULine1Thick#
  2785.         PRINT #1, PREFIX_CHAR$ & "UnderLine1 Thickness: " & SPACE_CHAR$ & DBLULine1Thick# & UNITS_PREFIX$ & Units$(UnderlineUnits&) & NEWLINE$
  2786.  
  2787.         DBLULine1Shift# = CDBL(ULine1Shift&)
  2788.         ConvertTo UnderlineUnits&, DBLULine1Shift#
  2789.         PRINT #1, PREFIX_CHAR$ & "UnderLine1 Shift: " & SPACE_CHAR$ & DBLULine1Shift# & UNITS_PREFIX$ & Units$(UnderlineUnits&) & NEWLINE$
  2790.  
  2791.         DBLULine2Thick# = CDBL(ULine2Thick&)
  2792.         ConvertTo UnderlineUnits&, DBLULine2Thick#
  2793.         PRINT #1, PREFIX_CHAR$ & "UnderLine2 Thickness: " & SPACE_CHAR$ & DBLULine2Thick# & UNITS_PREFIX$ & Units$(UnderlineUnits&) & NEWLINE$
  2794.  
  2795.         DBLULine2Shift# = CDBL(ULine2Shift&)
  2796.         ConvertTo UnderlineUnits&, DBLULine2Shift#
  2797.         PRINT #1, PREFIX_CHAR$ & "UnderLine2 Shift: " & SPACE_CHAR$ & DBLULine2Shift# & UNITS_PREFIX$ & Units$(UnderlineUnits&) & NEWLINE$
  2798.  
  2799.         DBLSuperscriptPS# = CDBL(SuperscriptPS!)
  2800.         ConvertTo UnderlineUnits&, FROMPOINTS(DBLSuperscriptPS#)
  2801.         Round DBLSuperscriptPS#, .010
  2802.         PRINT #1, PREFIX_CHAR$ & "Superscript Point Size: " & SPACE_CHAR$ & DBLSuperscriptPS# & UNITS_PREFIX$ & Units$(UnderlineUnits&) & NEWLINE$
  2803.  
  2804.         DBLSuperscriptShift# = CDBL(SuperscriptShift&)
  2805.         ConvertTo UnderlineUnits&, DBLSuperscriptShift#
  2806.         PRINT #1, PREFIX_CHAR$ & "Superscript Shift: "  & SPACE_CHAR$ & DBLSuperscriptShift# & UNITS_PREFIX$ & Units$(UnderlineUnits&) & NEWLINE$
  2807.  
  2808.         DBLSubscriptPS# = CDBL(SubscriptPS!)
  2809.         ConvertTo UnderlineUnits&, FROMPOINTS(DBLSubscriptPS#)
  2810.         Round DBLSubscriptPS#, .010
  2811.         PRINT #1, PREFIX_CHAR$ & "Subscript Point Size: "  & SPACE_CHAR$ & DBLSubscriptPS# & UNITS_PREFIX$ & Units$(UnderlineUnits&) & NEWLINE$
  2812.  
  2813.         DBLSubscriptShift# = CDBL(SubscriptShift&)
  2814.         ConvertTo UnderlineUnits&, DBLSubscriptShift#
  2815.         PRINT #1, PREFIX_CHAR$ & "Subscript Shift: "  & SPACE_CHAR$ & DBLSubscriptShift# & UNITS_PREFIX$ & Units$(UnderlineUnits&) & NEWLINE$
  2816.  
  2817.         SELECT CASE Tracking&
  2818.             CASE 0    : PRINT #1, PREFIX_CHAR$ & "Tracking type: " & SPACE_CHAR$ & "Very loose" & NEWLINE$
  2819.             CASE 1    : PRINT #1, PREFIX_CHAR$ & "Tracking type: " & SPACE_CHAR$ & "Looser" & NEWLINE$
  2820.             CASE 2    : PRINT #1, PREFIX_CHAR$ & "Tracking type: " & SPACE_CHAR$ & "Normal" & NEWLINE$
  2821.             CASE 3    : PRINT #1, PREFIX_CHAR$ & "Tracking type: " & SPACE_CHAR$ & "Tighter" & NEWLINE$
  2822.             CASE 4    : PRINT #1, PREFIX_CHAR$ & "Tracking type: " & SPACE_CHAR$ & "Very tight" & NEWLINE$
  2823.             CASE 5    : PRINT #1, PREFIX_CHAR$ & "Tracking type: " & SPACE_CHAR$ & "Custom" & NEWLINE$
  2824.             CASE ELSE    : PRINT #1, PREFIX_CHAR$ & "Tracking type: " & SPACE_CHAR$ & "Unknown" & NEWLINE$
  2825.         END SELECT
  2826.         PRINT #1, PREFIX_CHAR$ & "Tracking amount: "  & SPACE_CHAR$ & (TrackAmount&/10) & UNITS_PREFIX$ & "%" & NEWLINE$
  2827.         .FormatParaTagEnd
  2828.     END WITHOBJECT
  2829. END SUB
  2830.  
  2831.  
  2832.  
  2833.  
  2834.  
  2835.  
  2836.  
  2837.  
  2838.  
  2839.  
  2840.  
  2841.  
  2842.  
  2843.  
  2844.  
  2845.  
  2846.  
  2847.  
  2848.  
  2849.  
  2850. '/////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2851. ' This subroutine will round off the specified number (Value) 
  2852. ' to the number of decimal places specified by precision
  2853. SUB Round(Value#, Precision#)
  2854.     Fixed# = FIX(Value)
  2855.     FractValue# = (Value# - Fixed#) * (1/Precision#)
  2856.     FractFixed# = INT(FractValue)
  2857.     FractDelta# = FractValue# - FractFixed#
  2858.     IF FractDelta# >= 0.50 THEN
  2859.         FractFixed# = FractFixed# + 1.0
  2860.     ENDIF
  2861.     Value# = FIX(Value#) + (FractFixed# * Precision#)
  2862. END SUB
  2863.  
  2864.  
  2865. '/////////////////////////////////////////////////////////////////////////////////////////////////////
  2866. SUB ConvertTo(Units&, BYREF ConvertData AS DOUBLE) 
  2867.     SELECT CASE Units&
  2868.         CASE INCHES
  2869.             ConvertData = ConvertData / 254000
  2870.         CASE MILLIMETERS
  2871.             ConvertData = ConvertData / 10000
  2872.         CASE PICAS
  2873.             ConvertData = TOPICAS(ConvertData)
  2874.         CASE POINTS
  2875.             ConvertData = (ConvertData / 254000) * 72
  2876.         CASE CICEROS
  2877.             ConvertData = TOCICEROS(ConvertData)
  2878.         CASE DIDOTS
  2879.             ConvertData = TODIDOTS(ConvertData)
  2880.     END SELECT
  2881.     Round ConvertData#, .010
  2882. END SUB
  2883.  
  2884.