ࡱ> @,cRoot Entry Fb~h`_:)WordDocumentTCompObjj_KSummaryInformation$(<sBC  !"#$%&'-(<./0123489:;=tE?AJDGFdIKLMNOPQRSTUVWXYZ[\]^_`abefghijkluvwxyz{~Root Entry Fb~ "`_:)WordDocumentT6CompObjj_KSummaryInformation$(<sBC  !"#$%&'s(87m9:;=E?AJDGFdIKLMNOPQRSTUVWXYZ[\]^_`abefghijklnopqr|~, Returns to the position saved with SavePos.dgzjsaveLocdgjsaveLocs ddddiEraseHeaderFooterInfodgdg lgNk Go to Header areadgn lgQRk Go to Header areadgdgdgNRk Go to Footer areadgdgdgddddi TemplatePath$ditPath$ jdisize gld#ii l$isizedRitp$ gyiildRgitp$j DOC2HTML.DOT ldoitPath$ itp$do*iDonedRTd&dk4 MsgBox msg$, "Current Global Templates and Add-Ins"ditPath$ jdRg+j4DOC2HTML.DOT needs to be added as a global template.rdoj gl rdoj"Choose File:Templates, click Add, rdojand browse for the template.rdogl rdojThen click OK.dRgGldTeDonedi TemplatePath$ itPath$d dk DOC2HTML:dk# Creates a file called "XXXX.htm".dk; Where "XXXX" is the name of the currently active document.dk USAGE NOTESdk< * Things are easier to see if you open up this template anddk$ reduce it to a very small windowdk * To close the .HTM file:dk! 1. From File menu, choose CLOSEdk 2. Choose "Save changes YES" dk( 3. Choose "Text Only with Line Breaks"dk* 4. Unless particular spacing is desired,dk. a lot of documents should convert cleanlydk in a single pass.dk FEATURES:dk/ * Creates basic HTML structure (header & body)dk) * Creates HTML header information using:dk5 * Document properties Title & Author, if they existdk3 * Or using Title/Byline paragraphs, if they existdk; * Uses paragraph styles to create logical HTML format tagsdk@ * Table-driven conversion using editable table in this templatedk: * If paragraph has BorderTop() true, its preceded by
dk2 * Handles nested lists. Indents to show nesting.dk * Convert NL's to breaksdk1 * Convert non-heading bold & italic text styles dk (to logical format tags)dk. * Convert strikethrough text to formatdk; * Converts first tab or NL in a start-definition paragraphdk: to
...
. (controlled by the value of "Break Tag"dk in the table.dk TODO:dk4 * Find out what the right header tag is for author.dkE One authoring tool used "", butplit into at the first tab, if there is one, or at the first NL. The Break Tag column tells what tag to use at the break. The value none is required to indicate a null value (). For some reason, selecting an empty cell in Word Basic produces a weird value (or two), instead of a null string. To see the conversion as it happens, open this template first and make it real small. Then the accesses to the table wont keep putting this template in front of the document where it obscures the processing. Text formatting is automatically converted to logical tags by the macro: Bold text is converted to Italic text is converted to Striketrhough is converted to Special characters <, >, ", and & are converted to HTML literals (ex: "<" => "<") UNLESS they are in italics. That allows HTML controls to be embedded in the file, but they must be italicized. THIS ALSO APPLIES TO THE QUOTES. For example, in linkText, the quotes must be italicized as well.  FILENAME \* Lower\p \* MERGEFORMAT c:\eric\maclib\doc2html.dot  SAVEDATE \@ "d-MMM-yy" \* MERGEFORMAT 21-Mar-96 Page  PAGE \* MERGEFORMAT 2 of  NUMPAGES \* MERGEFORMAT 2 Eric Armstrong Revision # REVNUM \* MERGEFORMAT 50 /=dk DOC2HTML:dk# Creates a file called "XXXX.htm".dk; Where "XXXX" is the name of the currently active document.dk USAGE NOTESdk< * Things are easier to see if you open up this template anddk$ reduce it to a very small windowdk * To close the .HTM file:dk! 1. From File menu, choose CLOSEdk 2. Choose "Save changes YES" dk( 3. Choose "Text Only with Line Breaks"dk* 4. Unless particular spacing is desired,dk. a lot of documents should convert cleanlydk in a single pass.dk FEATURES:dk/ * Creates basic HTML structure (header & body)dk) * Creates HTML header information using:dk5 * Document properties Title & Author, if they existdk3 * Or using Title/Byline paragraphs, if they existdk; * Uses paragraph styles to create logical HTML format tagsdk@ * Table-driven conversion using editable table in this templatedk: * If paragraph has BorderTop() true, its preceded by
dk2 * Handles nested lists. Indents to show nesting.dk * Convert NL's to breaksdk1 * Convert non-heading bold & italic text styles dk (to logical format tags)dk. * Convert strikethrough text to formatdk; * Converts first tab or NL in a start-definition paragraphdk: to
...
. (controlled by the value of "Break Tag"dk in the table.dk TODO:dk4 * Find out what the right header tag is for author.dkE One authoring tool used "", but Netscape is displaying it.dk7 * Convert contained bmp files to Gif files and includedk * Convert tablesdk8 * Convert help file bitmap references to gif referencesdk$ and convert bmp files to Gif filesdk* * Convert help file links to HTML anchorsdkB * Read "addSpaceLimit" and text-substitution values from templatedk' (at the moment, they are hard-coded)dk RESTRICTIONS:dk< * A bug in Word prevents reading the Property sheet for thedkB Author value. For some reason, the reference to "stats.Author"dkA fails, even though the to reference to "stats.Title" succeeds.dkB (stats is the DocumentStatistics record). Workaround is to usedk4 the .LastSavedBy value, which is usually correct.dd/0istats4gNd/0i workWindow$d/0iconversionTableFile$d/0iconversionWindow$d/0i specialTag$d/0i startTag$d/0iendTag$d/0i listLeveld/0i listStartTag$d/0i listEndTag$d/0i listTagStack$ld/0i breakTag$d/0iindent$Rk Indent for nested listsd/0i addSpaceLimitdRk8 If paragraph's space-before value is greater than this,dRk9 Then add and extra line for spacing. (Using 5, for now)ddiInitdk Setup output filedicurrDir$ idocDir$dicurrDir$ jdRg+j&Current document has not been saved. gl rdonj/Please save it and make sure that DOC2HTML.DOT rdonjis in the same directory.dRgGldTdifn$ idocName$di firstWindow$ g;dgD lgDlRk go to Window statedidWidth gdidHeight gdidLeft gFdidTop gEddk Open conversion tablediconversionTableFile$ i templatePath$dgPs iconversionTableFile$sU ldRk* .ReadOnly = 1 was a nice idea, but becamedRk5 a nuisance -- cannot easily edit the table and retrydiconversionWindow$ g;dgl lHdglHRk 72 points, 1 inchdg2idLeftl idTopidHeightl k Underneath work windowddk Save HTM versiondgbi firstWindow$di pathname$ icurrDir$j\ifn$j.htmdgTs i pathname$s ldg2idLeftl idTopldi workWindow$ g;ddk Re-open the original filedgPs icurrDir$j\ifn$j.docdg3idWidthidHeightdg2idLeftidTopdgbi workWindow$ddk' Set up a style tag for processed linesdiindent$ j Rk 4 space indent for nested listsdi addSpaceLimit ldi specialTag$ jHTMLdgs i specialTag$s{ jNormals,dgs ls lrdRs lsD ldgs( ls# ls' lrdRs ls ls lrdRs] ls; ls$ ls% lddddiMAINdiGetStatsdiInitddi ProcessTextRk/ Before adding structure, to handle "<" and ">"di IndentCodediFixSectionBreaksdiAddStartStructurediProcessParagraphsdiProcessGraphicsdiAddEndStructurediCleanUpSpacingdiEraseHeaderFooterInfoddk) Leave the newly converted file open opendk- Leave conversion table open for adjustments.dk Activate conversionWindow$dk FileClose 2ddddiCleanUpSpacingdk PRETTY PRINTINGdk; List Continue styles (endList tag="NoChg") have
    addeddk< when they are not already part of a list. This makes extradk3 spacing, because they also start with
    or

    .dk This routine cleans that up.dkA Look for

      followed by paragraph mark (^p) and
      (or

      ).dk2 --Also allow for indentation (whitespace or ^w) dk before the
      or

      .dk. (This fast fix messes up the indentation.)di SpecialFixj

        ^p
        j
          Rk search string, what to insertdi SpecialFixj
            ^p^w
            j
              di SpecialFixj
                ^p

                j

                  di SpecialFixj
                    ^p^w

                    j

                      di SpecialFixj

                      ^p

                      j

                      k --fix

                      sequencesddk/ Any
                      ^p combinations remaining are spacers.dk5 But
                      won't work after an
                    • . Replace with

                      dgus j
                      ^pRs j

                      ^psrdRs ls lrdRs ls ls lrdRs ls} lddiAddSpacingLinesddddiAddSpacingLinesdk* Add a para break before & after a

                      tagdgdgps j

                      s ls lrdRs ls ls lrdRs ls} ld!g׀dRgdRgdRgldRgdRgd"ddk# Add a para break after a

                       tagdgdgpsj
                      slslrdRslslslrdRsls}ld!g׀dRgdRgdRgd"ddkB Add a para break before a heading tag 

                      ..

                      or

                      dgdgps j \]s ls lrdRs ls ls lrdRs ls} ld!g׀dRgdRgdRgldRgd"ddk+ Add a para break before a
                      tagdgdgps j
                      s ls lrdRs ls ls lrdRs ls} ld!g׀dRgdRgdRgl dRgd"ddddi SpecialFixis$ir$dk: This routine takes into account the special case when thedk9
                      or

                      is followed by a paragraph mark, rather thandk2 text. In that case, leave it -- its for spacing.dk; It expects the search string to end with a paragraph mark,dk; and inserts one after the replacement (can't insert "^p"!)dgdgps is$s ls lrdRs ls ls lrdRs ls} ld!g׀dRgj\seljtempdRgdRgg l dok0 Not at a paragraph mark. This is not a spacer.dok# Remove it, but preserve whitespacedogzjtempdogps j^wRk! Find whitespace in the selectiondog׀dogmok Save whitespacedogzjtempRk Replace original selection,dogir$ok removing the
                      or

                      tagdogdognok Reinsert whitespacedo dogir$dogdoTdRTdRgps is$s ls lrdos ls ls lrdos ls} ld"ddddi ProcessTextdRk Process Special CharactersdRdRk" TURN OFF SUBSTITUTIONS IN ITALICSdRk/ THAT MEANS HTML CAN BE EMBEDDED, IF ITALICIZEDdRgtdRgqs% ldRdRk ampersand-&dRi FixNonCodej&j&dRdRk dRi FixNonCodej>j>dRdRk quote-"dRi FixNonCodegl"j"dRdRk Non-breaking spacedRi FixNonCodej^sj dRdRk+ Process Bold, Italic, & Strikethrough TextdRiCleanParagraphMarksRk* Remove char formatting in paragraph marksdRgtdRgqs$ ldRiFixNonHeadingTextjj dRgtdRgqs% ldRiFixNonHeadingTextjjdRgtdRgqs ldRiFixNonHeadingTextjjddddiProcessGraphicsdRgdRk Search For graphicsdRgps j^gs ls lrdos ls ls lrdos ls} ldR!g׀dogdR"ddddiCleanParagraphMarksdRk1 Remove font characteristics from paragraph marksdRgtdRgydRgvs( ls# lrdos ls ls lrdos' ls] ls; lrdos$ ls% ldRgus j^ps j^psrdos ls lrdos ls ls lrdos ls} lddddiFixSectionBreaksdgdgps j^bs ls lrdRs ls ls lrdRs ls} ld!g׀dRgdRiAddLinej

                      ^pdRgd"ddddi FixNonCodeiold$inew$dk- Do the conversion, except in Code paragraphsdgdgps iold$s ls lrdRs ls ls lrdRs ls} ld!g׀dRis$ g"dRgis$l jCodedoginew$dRTdRgd"ddddiFixNonHeadingTextibeginIt$iendIt$dk9 Do the conversion, except in Heading or Title paragraphsdgdgps js ls lrdRs ls ls lrdRs ls} ld!g׀dRis$ g"dRngis$l jHeadingrdRgis$l jTitledogj \EndOfSeljEndPointdog.dogzj \StartOfSeldog.Rk' In case there is something ahead of usdogibeginIt$dogzjEndPointdogs jEndPoints dok% Necessary to fix Word bug. Where itdok" finds the bookmark as bold, next.dog.dogiendIt$dRTdRgd"ddddiProcessParagraphsdgdi laststartTag$ jdi lastEndTag$ jdi lastListLevel ld!g܁dRg" jHTML*iNextTagdRdRk Horizontal Rule ProcessingdRg$ ldoi AddIndenti listLeveldoiAddLinej
                      Rk Top Border => Horiz. RuledRTdRi Style2Tag$dRdRk* Special Title Processing (Title & Title2)dRni startTag$ i lastStartTag$rdRiendTag$ j

                      doiAddj
                      do*iNextTagdRTdRdRk Finish old tagdRi lastEndTag$ jdoi AddIndenti lastListLeveldoiAddLinei lastEndTag$dRTdRdRk List ProcessingdRi listEndTag$ jNoChgdok2 If not already in a list at this level, start onedok, This happens for "List Continue" paragraphsdoni listTagStack$i listLevel jdoi listStartTag$ j
                        doi listEndTag$ j
                      doi listTagStack$i listLevel i listEndTag$doTdRTdRi listLeveli lastListLeveldok Start new listdoi AddIndenti listLeveldoiAddi listStartTag$dR k listLevel <= lastListLeveldok Close all deeper-level listsdo#ii i lastListLevel$i listLevell%ldoi AddIndentiidoi listTagStack$ii jdoiAddLinei listTagStack$iidoi listTagStack$ii jdoTdo&iidok> If still in a list, check list type to make sure its the samedoni listLevel lrdoi listEndTag$ jNoChgrdoi listTagStack$i listLevel i listEndTag$dok! Close old list and start new onedoi listTagStack$i listLevel jdoi AddIndenti lastListLeveldoiAddLinei listTagStack$i listLeveldoTdoi listStartTag$ jdoi AddIndenti listLeveldoiAddLinei listStartTag$doTdoi listTagStack$i listLevel i listEndTag$doTdRTddRk Special Tag ProcessingdR/ipFormat4gdR>ipFormatdRis$ ipFormatsok="3 pt", or "12 pt", etc.dRispaceBef ggis$gis$j ldRni startTag$ j

                      or
                      dok) Tag to use depends on space-before valuedonispaceBefi addSpaceLimitdoi startTag$ j

                      do doi startTag$ j
                      doTdRTdRni startTag$ j

                      rdRi startTag$ j
                      dok+ Add an extra line, when needed for leadingdoisn$ g"donispaceBefi addSpaceLimitrdogisn$l jHeadingrdoisn$ jTitlerdoisn$ jTitle2rdoisn$ jSubtitlerdoisn$ jSummarydoiAddLinej

                      doTdRTdRi breakTag$ j

                      dok2 Replace first tab or NL in paragraph w/ break tagdogzj\Parank Restrict to curr paragraphdok Replace first tab.dogus j^ts i breakTag$rdoss ls lrdos ls ls lrdos ls} ldog׀dok" Tab not found. Replace first NL.dogus j^ls i breakTag$rdoss ls lrdos ls ls lrdos ls} ldoTdok- Return To original position at start of paradogzj\ParadogdRTdRdRk Start new tagdRi AddIndenti listLeveldRiAddi startTag$Rk Noop if nulldRiConvertNewlinesdeNextTagdRgi specialTag$dRgdRi lastStartTag$ i startTag$dRi lastEndTag$ iendTag$dRi lastListLevel i listLeveldRni listLevellrdRi listEndTag$ jNoChgdoi listTagStack$i listLevel i listEndTag$dRTd"ddddi IndentCodedRgdRgtdRgss jCodedRgps js ls lrdos ls ls lrdos ls} ldR!g׀dogdogj dogzj\Paradogdogps js ls lrdos ls ls lrdos ls} ldR"ddddiConvertNewlinesdis$ j^piIndentSpacing$i listLevelj
                      dgzj\Paradgus j^lrdos is$srdos ls ls lrdos ls ls lrdos} lddddi Style2Tag$dis$ g"dgbiconversionWindow$dgdgdgps is$s ls lrdRs ls ls lrdRs ls} ldg׀dRi startTag$ iGetNextCellVal$dRiendTag$ iGetNextCellVal$dRi listLevel giGetNextCellVal$dRi listStartTag$ iGetNextCellVal$dRi listEndTag$ iGetNextCellVal$dRi breakTag$ iGetNextCellVal$d dRiresponse g+jUndefined style: is$rdonj. Using default tags. rdonj7To eliminate this message, put an entry in DOC2HTML.DOTrdnjDOC2HTMLldRiresponse lgGldRi startTag$ j

                      dRiendTag$ jdRkB Note: Leave current list level and list start/end tags unchanged.dTdeDonedgbi workWindow$ddddiGetNextCellVal$dgπdis$ gdis$ jnoneis$ jdiGetNextCellVal$ is$ddddiAddStartStructuredgdiAddLinejdiAddLinejdi ProcessHeaderdiAddLinejdiAddLinejRk Extra para breakdkAddLine("")diAddLinejddddiAddEndStructuredgdgRk (Don't use AddLine here)ddk Close any open listsd#ii l$l%ldRi listTagStack$ii jdoi AddIndentiidoiAddLinei listTagStack$iidoi listTagStack$ii jdRd&iiddiAddLinejdiAddLinejddddi ProcessHeaderdiSavePosdit$ i docTitle$dia$ i docAuthor$di RestorePosdit$ jiAddLinejit$jdk< Is the right tag? Its showing up in the document,dk' even though its defined in the header.dk8 If a$ <> "" Then AddLine("" + a$ + "")ddddiAdditag$dgitag$dgi specialTag$ddddiAddLineitag$dk Adds a tag line dk& Does not change existing para's styledgitag$dgdgdgi specialTag$dgddddi AddIndentileveldilevelldR#ii l$ileveldogiindent$dR&iidTddddiIndentSpacing$ileveldis$ jdilevelldR#ii l$ileveldois$ is$iindent$dR&iidTdiIndentSpacing$ is$ddddiGetStatsdgVs.RkUpdate doc statsd>istatsddddi docAuthor$dk! Returns name of current documentdk, WORD BUG: "stats.Author" = "undefined fielddk3 EVEN THOUGH: When saving, the syntax is recognizeddk- ("Author" is automatically init-capped)dis$ istatsskRk Workarounddis$ j*iDoneddk. Look for "byline" or "Byline" paragraph styledgdgejbyline jdRgss jbylinedRgps js ls lrdos ls ls lrdos ls} ldRg׀dogllRk Eliminate the paragraph markdois$ gdo*iDonedRTdTdgejByline jdRgss jBylinedRgps js ls lrdos ls ls lrdos ls} ldRg׀dogllRk Eliminate the paragraph markdois$ gdo*iDonedRTdTdeDonedi docAuthor$ is$ddddi docTitle$dRk! Returns name of current documentdRk Look for title paragraphs(s)dRgdRgss jTitledRgps js ls lrdos ls ls lrdos ls} ldRg׀dogllRk Eliminate the paragraph markdois$ gdRTdRidoit ldR!idoit ldok" Concatenate additional paragraphsdoglRk Go to next paradog" osoft Word for Windows 95@@ܧ@`t@.L_:5՜.+,0HP\dl t|    #DOCument To HTML Conversion Filter FMicrosoft Word Document MSWordDocWord.Document.69qOh+'0  8D l x  #DOCument To HTML Conversion FilterDEric ArmstrongO   Doc2html.dotEric Armstrong142MicrhA:15 _ $R"DOCument To HTML Conversion FilterEric ArmstrongEric Armstrongy StevensonIDG Books, Foster City b,Nancy StevensonIDG Books, Foster City c)IDG Books, Foster City Michael Koch l)IDG Books, Foster City Michael Koch l)IDG Books, Foster City Michael Koch l-IDG Books, Foster CityForrest Houlette F-Forrest HouletteIDG Books, Foster City o,Nancy StevensonIDG Books, Foster City 7"Nancy Stevenson Michael Koch l"Nancy Stevenson Michael Koch l"Nancy Stevenson Michael Koch l"Nancy Stevenson Michael Koch l}HGjTitlerdog" jTitle2dog dog ldogllRk Eliminate the paragraph markdois$ is$j gdoidoit ldo doidoit ldoTdR"dRgtdRi docTitle$ is$ddddidocName$dk! Returns name of current documentdis$ istatssgdidotIndex gis$j.didocName$ gis$idotIndexlddddidocDir$dk6 Returns the directory containing the current documentdidocDir$ istatsshddddiSavePosdk7 Saves the current position for later use by RestorePosdgjsaveLocsddddi RestorePosdk, Returns to the position saved with SavePos.dgzjsaveLocdgjsaveLocs ddddiEraseHeaderFooterInfodgdg lgNk Go to Header areadgn lgQRk Go to Header areadgdgdgNRk Go to Footer areadgdgdgddddi TemplatePath$ditPath$ jdisize gld#ii l$isizedRitp$ gyiildRgitp$j DOC2HTML.DOT ldoitPath$ itp$do*iDonedRTd&dk4 MsgBox msg$, "Current Global Templates and Add-Ins"ditPath$ jdRg+j4DOC2HTML.DOT needs to be added as a global template.rdoj gl rdoj"Choose File:Templates, click Add, rdojand browse for the template.rdogl rdojThen click OK.dRgGldTeDonedi TemplatePath$ itPath$d  g o 5678_`ijpqTT&r5666dwew*-67FXYAQRSTUVWZuauD[UN!.:IV`afkprw|4[ jRR4[ jRR4[ jRR4[ jRRl vX #4lX vX #  !&+-27<=EV[]bglmw|4[ jRR4[ jRR4[ jRR4[ jRR4[ jRR4[l vX #*  %*/0:?EGLQVW\afhqx}~ jRR4[ jRR4[ jRR4[ jRR4[ jRR4[ l vX #*  #%*056DINPU[jRR4[ jRR4[ jRR4[ jRR4[ jRR4[ jl vX #*r" is automatically init-capped)dis$ istatsskRk Workarounddis$ j*iDoneddk. Look for "byline" or "Byline" paragraph styledgdgejbyline jdRgss jbylinedRgps js ls lrdos ls ls lrdos ls} ldRg׀dogllRk Eliminate the paragraph markdois$ gdo*iDonedRTdTdgejByline jdRgss jBylinedRgps js ls lrdos ls ls lrdos ls} ldRg׀dogllRk Eliminate the paragraph markdois$ gdo*iDoܥhW erj&j&:::::^  @C==^ÎÎÎI <H<XJR :+, ::8H::~ "`_:Nb"::::Word Para StyleHTML Start TagHTML End TagList LevelList Start TagList End TagBreak TagHTMLnonenone0nonenonenoneTitle

                      

                      0nonenonenoneSubtitle

                      

                      0nonenonenoneSummary
                       or
                      " says to use

                      if the paragraph's space-before property is 6 pts or more, and to use
                      " if it is less than 6 pts. This only applies to non-Heading, non-Title styles. 2 The list levels in the table tell the DOC2HTML macro when to start a new list and when to end an old one. 2bi 2 (Also, take a look at the comments at the top of this file.) 2 macro 2 2dk DOC2HTML:dk# Creates a file called "XXXX.htm".dk; Where "XXXX" is the name of the curren&Nancy StevensonForrest Houlette ; "Nancy Stevenson Michael Koch l!,Nancy StevensonIDG Books, Foster City o""Nancy Stevenson Michael Koch l#Tonymck$)IDG Books, Foster City Michael Koch Z%,Nancy StevensonIDG Books, Foster Cityf 3&,Nancy StevensonIDG Books, Foster City& '"Nancy Stevenson Michael Koch ("Nancy Stevenson Michael Koch %)"Nancy Stevenson Michael Koch 5*"Nancy Stevenson Michael Koch 9+"Nancy Stevenson Michael Koch ,"Nancy Stevensontly active document.dk USAGE NOTESdk< * Things are easier to see if you open up this template anddk$ reduce it to a very small windowdk * To close the .HTM file:dk! 1. From File menu, choose CLOSEdk 2. Choose "Save changes YES" dk( 3. Choose "Text Only with Line Breaks"dk* 4. Unless particular spacing is desired,dk. a lot of documents should convert cleanlydk in a single pass.dk FEATURES:dk/ * Creates basic HTML structure (header & body)dk) * Creates HTML header information using:dk5 * l rdonj/Please save it and make sure that DOC2HTML.DOT rdonjis in the same directory.dRgGldTdifn$ idocName$di firstWindow$ g;dgD lgDlRk go to Window statedidWidth gdidHeight gdidLeft gFdidTop gEddk Open conversion tablediconversionTableFile$ i templatePath$dgPs iconversionTableFile$sU ldRk* .ReadOnly = 1 was a nice idea, but becamedRk5 a nuisance -- cannot easily edit the table and retrydiconversionWindow$ g;dgl lHdglHRk 72 points, 1 inchdg2idLeftl idTopidHeightl k Underneath work windowddk Save HTM versiondgbi firstWindow$di pathname$ icurrDir$j\ifn$j.htmdgTs i pathname$s ldg2idLeftl idTopldi workWindow$ g;ddk Re-open the original filedgPs icurrDir$j\ifn$j.docdg3idWidthidHeightdg2idLeftidTopdgbi workWindow$ddk' Set up a style tag for processed linesdiindent$ j Rk 4 space indent for nested listsdi addSpaceLimit ldi specialTag$ jHTMLdgs i specialTag$s{ jNormals, dgs ls lrdRs lsD ldgs( ls# ls' lrdRs ls ls lrdRs] ls; ls$ ls% lddddiMAINdiGetStatsdiInitddi ProcessTextRk/ Before adding structure, to handle "<" and ">"di IndentCodediFixSectionBreaksdiAddStartStructurediProcessParagraphsdiProcessGraphicsdiAddEndStructurediCleanUpSpacingdiEraseHeaderFooterInfoddk) Leave the newly converted file open opendk- Leave conversion table open for adjustments.dk Activate conversionWindow$dk FileClose 2dDocumentSummaryInformation8 Netscape is displaying it.dk7 * Convert contained bmp files to Gif files and includedk * Convert tablesdk8 * Convert help file bitmap references to gif referencesdk$ and convert bmp files to Gif filesdk* * Convert help file links to HTML anchorsdkB * Read "addSpaceLimit" and text-substitution values from templatedk' (at the moment, they are hard-coded)dk RESTRICTIONS:dk< * A bug in Word prevents reading the Property sheet for thedkB Author value. For some reason, the reference to "stats.Author"dkA fails, even though the to reference to "stats.Title" succeeds.dkB (stats is the DocumentStatistics record). Workaround is to usedk4 the .LastSavedBy value, which is usually correct.dd/0istats4gNd/0i workWindow$d/0iconversionTableFile$d/0iconversionWindow$d/0i specialTag$d/0i startTag$d/0iendTag$d/0i listLeveld/0i listStartTag$d/0i listEndTag$d/0i listTagStack$ld/0i breakTag$d/0iindent$Rk Indent for nested listsd/0i addSpaceLimitdRk8 If paragraph's space-before value is greater than this,dRDocument properties Title & Author, if they existdk3 * Or using Title/Byline paragraphs, if they existdk; * Uses paragraph styles to create logical HTML format tagsdk@ * Table-driven conversion using editable table in this templatedk: * If paragraph has BorderTop() true, its preceded by


                      dk2 * Handles nested lists. Indents to show nesting.dk * Convert NL's to breaksdk1 * Convert non-heading bold & italic text styles dk (to logical format tags)dk. * Convert strikethrough text to formatdk; * Converts first tab or NL in a start-definition paragraphdk: to
                      ...
                      . (controlled by the value of "Break Tag"dk in the table.dk TODO:dk4 * Find out what the right header tag is for author.dkE One authoring tool used "", but Netscape is displaying it.dk7 * Convert contained bmp files to Gif files and includedk * Convert tablesdk8 * Convert help file bitmap references to gif referencesdk$ and convert bmp files to Gif filesdk* * Convert help file links to HTML anchorsdkB * Read "addSpacek9 Then add and extra line for spacing. (Using 5, for now)ddiInitdk Setup output filedicurrDir$ idocDir$dicurrDir$ jdRg+j&Current document has not been saved. gl rdonj/Please save it and make sure that DOC2HTML.DOT rdonjis in the same directory.dRgGldTdifn$ idocName$di firstWindow$ g;dgD lgDlRk go to Window statedidWidth gdidHeight gdidLeft gFdidTop gEddk Open conversion tablediconversionTableFile$ i templatePath$dgPs iconversionTableFilerrent document has not been saved. gl rdonj/Please save it and make sure that DOC2HTML.DOT rdonjis in the same directory.dRgGldTdifn$ idocName$di firstWindow$ g;dgD lgDlRk go to Window statedidWidth gdidHeight gdidLeft gFdidTop gEddk Open conversion tablediconversionTableFile$ i templatePath$dgPs iconversionTableFile$sU ldRk* .ReadOnly = 1 was a nice idea, but becamedRk5 a nuisance -- cannot easily edit the table and retrydiconversionWindow$ g;dgl lHdglHRk 72 points, 1 inchdg2idLeftl idTopidHeightl k Underneath work windowddk Save HTM versiondgbi firstWindow$di pathname$ icurrDir$j\ifn$j.htmdgTs i pathname$s ldg2idLeftl idTopldi workWindow$ g;ddk Re-open the original filedgPs icurrDir$j\ifn$j.docdg3idWidthidHeightdg2idLeftidTopdgbi workWindow$ddk' Set up a style tag for processed linesdiindent$ j Rk 4 space indent for nested listsdi addSpaceLimit ldi specialTag$ jHTMdddiCleanUpSpacingdk PRETTY PRINTINGdk; List Continue styles (endList tag="NoChg") have
                        addeddk< when they are not already part of a list. This makes extradk3 spacing, because they also start with
                        or

                        .dk This routine cleans that up.dkA Look for

                          followed by paragraph mark (^p) and
                          (or

                          ).dk2 --Also allow for indentation (whitespace or ^w) dk before the
                          or

                          .dk. (This fast fix messes up the indentation.)di SpecialFixj

                            ^p
                            j
                              Rk search string, what toLdgs i specialTag$s{ jNormals,dgs ls lrdRs lsD ldgs( ls# ls' lrdRs ls ls lrdRs] ls; ls$ ls% lddddiMAINdiGetStatsdiInitddi ProcessTextRk/ Before adding structure, to handle "<" and ">"di IndentCodediFixSectionBreaksdiAddStartStructurediProcessParagraphsdiProcessGraphicsdiAddEndStructurediCleanUpSpacingdiEraseHeaderFooterInfoddk) Leave the newly converted file open opendk- Leave conversion table open for adjustments.dk Activate conversionWindow$dk FileClose 2ddddiCleanUpSpacingdk PRETTY PRINTINGdk; List Continue styles (endList tag="NoChg") have
                                addeddk< when they are not already part of a list. This makes extradk3 spacing, because they also start with
                                or

                                .dk This routine cleans that up.dkA Look for

                                  followed by paragraph mark (^p) and
                                  (or

                                  ).dk2 --Also allow for indentation (whitespace or ^w) dk before the
                                  or

                                  .dk. (This fast fix messes up the indentation.)di SpecialFixj

                                    ^p
                                    j
                                      Rk search string, what to insertdi SpecialFixj
                                        ^p^w
                                        j
                                          di SpecialFixj
                                            ^p

                                            j

                                              di SpecialFixj
                                                ^p^w

                                                j

                                                  di SpecialFixj

                                                  ^p

                                                  j

                                                  k --fix

                                                  sequencesddk/ Any
                                                  ^p combinations remaining are spacers.dk5 But
                                                  won't work after an
                                                • . Replace with

                                                  dgus j
                                                  ^pRs j

                                                  ^psrdRs ls lrdRs ls ls lrdRs ls} lddiAddSpacingLinesddddiAddSpacingLinesdk* Add a para break before & after a

                                                  tagdgdgps j

                                                  s ls lrdRs ls ls lrdRs ls} ld!g׀dRgdRgdRgldRgdRgd"ddk# Add a para break after a

                                                   tagdgdgpsj
                                                  slslrdRslslslrdRsls}ld!g׀dRgdRgdRgd"ddkB Add a para break before a heading tag 

                                                  ..

                                                  or

                                                  dgdgps j \]s ls lrdRs ls ls lrdRs ls} ld!g׀dRgdRgdRgldRgd"ddk+ Add a para break before a
                                                  tagdgdgps j
                                                  s ls lrdRs ls ls lrdRs ls} ld!g׀dRgdRgdRgl dRgd"ddk# Move
                                                  tags to end of prev linedgdgps j
                                                  s ls lrdRs ls ls lrdRs ls} ld!g׀dRgj
                                                  dRgdRgps j
                                                  s lrdos ls lrdos ls lrdos ls} ld"ddddi SpecialFixis$ir$dk: This routine takes into account the special case when thedk9
                                                  or

                                                  is followed by a paragraph mark, rather thandk2 text. In that case, leave it -- its for spacing.dk; It expects the search string to end with a paragraph mark,dk; and inserts one after the replacement (can't insert "^p"!)dgdgps is$s ls lrdRs ls ls lrdRs ls} ld!g׀dRgj\seljtempdRgdRgg l dok0 Not at a paragraph mark. This is not a spacer.dok# Remove it, but preserve whitespacedogzjtempdogps j^wRk! Find whitespace in the selectiondog׀dogmok Save whitespacedogzjtempRk Replace original selection,dogir$ok removing the
                                                  or

                                                  tagdogdognok Reinsert whitespacedo dogir$dogdoTdRTdRgps is$s ls lrdos ls ls lrdos ls} ld"ddddi ProcessTextdRk Process Special CharactersdRdRk" TURN OFF SUBSTITUTIONS IN ITALICSdRk/ THAT MEANS HTML CAN BE EMBEDDED, IF ITALICIZEDdRgtdRgqs% ldRdRk ampersand-&dRi FixNonCodej&j&dRdRk dRi FixNonCodej>j>dRdRk quote-"dRi FixNonCodegl"j"dRdRk Non-breaking spacedRi FixNonCodej^sj dRdRk+ Process Bold, Italic, & Strikethrough TextdRiCleanParagraphMarksRk* Remove char formatting in paragraph marksdRgtdRgqs$ ldRiFixNonHeadingTextjj dRgtdRgqs% ldRiFixNonHeadingTextjjdRgtdRgqs ldRiFixNonHeadingTextjjddddiProcessGraphicsdRgdRk Search For graphicsdRgps j^gs ls lrdos ls ls lrdos ls} ldR!g׀dogdR"ddddiCleanParagraphMarksdRk1 Remove font characteristics from paragraph marksdRgtdRgydRgvs( ls# lrdos ls ls lrdos' ls] ls; lrdos$ ls% ldRgus j^ps j^psrdos ls lrdos ls ls lrdos ls} lddddiFixSectionBreaksdgdgps j^bs ls lrdRs ls ls lrdRs ls} ld!g׀dRgdRiAddLinej

                                                  ^pdRgd"ddddi FixNonCodeiold$inew$dk- Do the conversion, except in Code paragraphsdgdgps iold$s ls lrdRs ls ls lrdRs ls} ld!g׀dRis$ g"dRgis$l jCodedoginew$dRTdRgd"ddddiFixNonHeadingTextibeginIt$iendIt$dk9 Do the conversion, except in Heading or Title paragraphsdgdgps js ls lrdRs ls ls lrdRs ls} ld!g׀dRis$ g"dRngis$l jHeadingrdRgis$l jTitledogj \EndOfSeljEndPointdog.dogzj \StartOfSeldog.Rk' In case there is something ahead of usdogibeginIt$dogzjEndPointdogs jEndPoints dok% Necessary to fix Word bug. Where itdok" finds the bookmark as bold, next.dog.dogiendIt$dRTdRgd"ddddiProcessParagraphsdgdi laststartTag$ jdi lastEndTag$ jdi lastListLevel ld!g܁dRg" jHTML*iNextTagdRdRk Horizontal Rule ProcessingdRg$ ldoi AddIndenti listLeveldoiAddLinej
                                                  Rk Top Border => Horiz. RuledRTdRi Style2Tag$dRdRk* Special Title Processing (Title & Title2)dRni startTag$ i lastStartTag$rdRiendTag$ j

                                                  doiAddj
                                                  do*iNextTagdRTdRdRk Finish old tagdRi lastEndTag$ jdoi AddIndenti lastListLeveldoiAddLinei lastEndTag$dRTdRdRk List ProcessingdRi listEndTag$ jNoChgdok2 If not already in a list at this level, start onedok, This happens for "List Continue" paragraphsdoni listTagStack$i listLevel jdoi listStartTag$ j
                                                    doi listEndTag$ j
                                                  doi listTagStack$i listLevel i listEndTag$doTdRTdRi listLeveli lastListLeveldok Start new listdoi AddIndenti listLeveldoiAddi listStartTag$dR k listLevel <= lastListLeveldok Close all deeper-level listsdo#ii i lastListLevel$i listLevell%ldoi AddIndentiidoi listTagStack$ii jdoiAddLinei listTagStack$iidoi listTagStack$ii jdoTdo&iidok> If still in a list, check list type to make sure its the samedoni listLevel lrdoi listEndTag$ jNoChgrdoi listTagStack$i listLevel i listEndTag$dok! Close old list and start new onedoi listTagStack$i listLevel jdoi AddIndenti lastListLeveldoiAddLinei listTagStack$i listLeveldoTdoi listStartTag$ jdoi AddIndenti listLeveldoiAddLinei listStartTag$doTdoi listTagStack$i listLevel i listEndTag$doTdRTddRk Special Tag ProcessingdR/ipFormat4gdR>ipFormatdRis$ ipFormatsok="3 pt", or "12 pt", etc.dRispaceBef ggis$gis$j ldRni startTag$ j

                                                  or
                                                  dok) Tag to use depends on space-before valuedonispaceBefi addSpaceLimitdoi startTag$ j

                                                  do doi startTag$ j
                                                  doTdRTdRni startTag$ j

                                                  rdRi startTag$ j
                                                  dok+ Add an extra line, when needed for leadingdoisn$ g"donispaceBefi addSpaceLimitrdogisn$l jHeadingrdoisn$ jTitlerdoisn$ jTitle2rdoisn$ jSubtitlerdoisn$ jSummarydoiAddLinej

                                                  doTdRTdRi breakTag$ j

                                                  dok2 Replace first tab or NL in paragraph w/ break tagdogzj\Parank Restrict to curr paragraphdok Replace first tab.dogus j^ts i breakTag$rdoss ls lrdos ls ls lrdos ls} ldog׀dok" Tab not found. Replace first NL.dogus j^ls i breakTag$rdoss ls lrdos ls ls lrdos ls} ldoTdok- Return To original position at start of paradogzj\ParadogdRTdRdRk Start new tagdRi AddIndenti listLeveldRiAddi startTag$Rk Noop if nulldRiConvertNewlinesdeNextTagdRgi specialTag$dRgdRi lastStartTag$ i startTag$dRi lastEndTag$ iendTag$dRi lastListLevel i listLeveldRni listLevellrdRi listEndTag$ jNoChgdoi listTagStack$i listLevel i listEndTag$dRTd"ddddi IndentCodedRgdRgtdRgss jCodedRgps js ls lrdos ls ls lrdos ls} ldR!g׀dogdogj dogzj\Paradogdogps js ls lrdos ls ls lrdos ls} ldR"ddddiConvertNewlinesdis$ j^piIndentSpacing$i listLevelj
                                                  dgzj\Paradgus j^lrdos is$srdos ls ls lrdos ls ls lrdos} lddddi Style2Tag$dis$ g"dgbiconversionWindow$dgdgdgps is$s ls lrdRs ls ls lrdRs ls} ldg׀dRi startTag$ iGetNextCellVal$dRiendTag$ iGetNextCellVal$dRi listLevel giGetNextCellVal$dRi listStartTag$ iGetNextCellVal$dRi listEndTag$ iGetNextCellVal$dRi breakTag$ iGetNextCellVal$d dRiresponse g+jUndefined style: is$rdonj. Using default tags. rdonj7To eliminate this message, put an entry in DOC2HTML.DOTrdnjDOC2HTMLldRiresponse lgGldRi startTag$ j

                                                  dRiendTag$ jdRkB Note: Leave current list level and list start/end tags unchanged.dTdeDonedgbi workWindow$ddddiGetNextCellVal$dgπdis$ gdis$ jnoneis$ jdiGetNextCellVal$ is$ddddiAddStartStructuredgdiAddLinejdiAddLinejdi ProcessHeaderdiAddLinejdiAddLinejRk Extra para breakdkAddLine("")diAddLinejddddiAddEndStructuredgdgRk (Don't use AddLine here)ddk Close any open listsd#ii l$l%ldRi listTagStack$ii jdoi AddIndentiidoiAddLinei listTagStack$iidoi listTagStack$ii jdRd&iiddiAddLinejdiAddLinejddddi ProcessHeaderdiSavePosdit$ i docTitle$dia$ i docAuthor$di RestorePosdit$ jiAddLinejit$jdk< Is the right tag? Its showing up in the document,dk' even though its defined in the header.dk8 If a$ <> "" Then AddLine("" + a$ + "")ddddiAdditag$dgitag$dgi specialTag$ddddiAddLineitag$dk Adds a tag line dk& Does not change existing para's styledgitag$dgdgdgi specialTag$dgddddi AddIndentileveldilevelldR#ii l$ileveldogiindent$dR&iidTddddiIndentSpacing$ileveldis$ jdilevelldR#ii l$ileveldois$ is$iindent$dR&iidTdiIndentSpacing$ is$ddddiGetStatsdgVs.RkUpdate doc statsd>istatsddddi docAuthor$dk! Returns name of current documentdk, WORD BUG: "stats.Author" = "undefined fielddk3 EVEN THOUGH: When saving, the syntax is recognizeddk- ("Author" is automatically init-capped)dis$ istatsskRk Workarounddis$ j*iDoneddk. Look for "byline" or "Byline" paragraph styledgdgejbyline jdRgss jbylinedRgps js ls lrdos ls ls lrdos ls} ldRg׀dogllRk Eliminate the paragraph markdois$ gdo*iDonedRTdTdgejByline jdRgss jBylinedRgps js ls lrdos ls ls lrdos ls} ldRg׀dogllRk Eliminate the paragraph markdois$ gdo*iDonedRTdTdeDonedi docAuthor$ is$ddddi docTitle$dRk! Returns name of current documentdRk Look for title paragraphs(s)dRgdRgss jTitledRgps js ls lrdos ls ls lrdos ls} ldRg׀dogllRk Eliminate the paragraph markdois$ gdRTdRidoit ldR!idoit ldok" Concatenate additional paragraphsdoglRk Go to next paradog" jTitlerdog" jTitle2dog dog ldogllRk Eliminate the paragraph markdois$ is$j gdoidoit ldo doidoit ldoTdR"dRgtdRi docTitle$ is$ddddidocName$dk! Returns name of current documentdis$ istatssgdidotIndex gis$j.didocName$ gis$idotIndexlddddidocDir$dk6 Returns the directory containing the current documentdidocDir$ istatsshddddiSavePosdk7 Saves the current position for later use by RestorePosdgjsaveLocsddddi RestorePosdk%5 !"#$>'()*+,-./01234F6789:;<=>?@ABCDE5HIPJKLMNO&QRSTUVWLimit" and text-substitution values from templatedk' (at the moment, they are hard-coded)dk RESTRICTIONS:dk< * A bug in Word prevents reading the Property sheet for thedkB Author value. For some reason, the reference to "stats.Author"dkA fails, even though the to reference to "stats.Title" succeeds.dkB (stats is the DocumentStatistics record). Workaround is to usedk4 the .LastSavedBy value, which is usually correct.dd/0istats4gNd/0i workWindow$d/0iconversionTableFile$d/0iconversionWindow$d/0i specialTag$d/0i startTag$d/0iendTag$d/0i listLeveld/0i listStartTag$d/0i listEndTag$d/0i listTagStack$ld/0i breakTag$d/0iindent$Rk Indent for nested listsd/0i addSpaceLimitdRk8 If paragraph's space-before value is greater than this,dRk9 Then add and extra line for spacing. (Using 5, for now)ddiInitdk Setup output filedicurrDir$ idocDir$dicurrDir$ jdRg+j&Current document has not been saved. gl rdonj/Please save it and make sure that DOC2HTML.DOT rdonjis in the same directory.dRgGldTdifn$ idocName$di firstWindow$ g;dgD lgDlRk go to Window statedidWidth gdidHeight gdidLeft gFdidTop gEddk Open conversion tablediconversionTableFile$ i templatePath$dgPs iconversionTableFile$sU ldRk* .ReadOnly = 1 was a nice idea, but becamedRk5 a nuisance -- cannot easily edit the table and retrydiconversionWindow$ g;dgl lHdglHRk 72 points, 1 inchdg2idLeftl idTopidHeightl k Underneath work windowddk Save HTM versiondgbi firstWindow$di pathname$ icurrDir$j\ifn$j.htmdgTs i pathname$s ldg2idLeftl idTopldi workWindow$ g;ddk Re-open the original filedgPs icurrDir$j\ifn$j.docdg3idWidthidHeightdg2idLeftidTopdgbi workWindow$ddk' Set up a style tag for processed linesdiindent$ j Rk 4 space indent for nested listsdi addSpaceLimit ldi specialTag$ jHTMLdgs i specialTag$s{ jNormals,dgs ls lrdRs lsD ldgs( ls# ls' lrdRs ls ls lrdRs] ls; ls$ ls% lddddiMAINdiGetStatsdiInitddi ProcessTextRk/ Before adding structure, to handle "<" and ">"di IndentCodediFixSectionBreaksdiAddStartStructurediProcessParagraphsdiProcessGraphicsdiAddEndStructurediCleanUpSpacingdiEraseHeaderFooterInfoddk) Leave the newly converted file open opendk- Leave conversion table open for adjustments.dk Activate conversionWindow$dk FileClose 2ddddiCleanUpSpacingdk PRETTY PRINTINGdk; List Continue styles (endList tag="NoChg") have

                                                    addeddk< when they are not already part of a list. This makes extradk3 spacing, because they also start with
                                                    or

                                                    .dk This routine cleans that up.dkA Look for

                                                      followed by paragraph mark (^p) and
                                                      (or

                                                      ).dk2 --Also allow for indentation (whitespace or ^w) dk before the
                                                      or

                                                      .dk. (This fast fix messes up the indentation.)di SpecialFixj

                                                        ^p
                                                        j
                                                          Rk search string, what to insertdi SpecialFixj
                                                            ^p^w
                                                            j
                                                              di SpecialFixj
                                                                ^p

                                                                j

                                                                  di SpecialFixj
                                                                    ^p^w

                                                                    j

                                                                      di SpecialFixj

                                                                      ^p

                                                                      j

                                                                      k --fix

                                                                      sequencesddk/ Any
                                                                      ^p combinations remaining are spacers.dk5 But
                                                                      won't work after an
                                                                    • . Replace with

                                                                      dgus j
                                                                      ^pRs j

                                                                      ^psrdRs ls lrdRs ls ls lrdRs ls} lddiAddSpacingLinesddddiAddSpacingLinesdk* Add a para break before & after a

                                                                      tagdgdgps j

                                                                      s ls lrdRs ls ls lrdRs ls} ld!g׀dRgdRgdRgldRgdRgd"ddk# Add a para break after a

                                                                       tagdgdgpsj
                                                                      slslrdRslslslrdRsls}ld!g׀dRgdRgdRgd"ddkB Add a para break before a heading tag 

                                                                      ..

                                                                      or

                                                                      dgdgps j \]s ls lrdRs ls ls lrdRs ls} ld!g׀dRgdRgdRgldRgd"ddk+ Add a para break before a
                                                                      tagdgdgps j
                                                                      s ls lrdRs ls ls lrdRs ls} ld!g׀dRgdRgdRgl dRgd"ddk# Move
                                                                      tags to end of prev linedgdgps j^p
                                                                      s ls lrdRs ls ls lrdRs ls} ld!g׀dRgj
                                                                      dRgdRgps j
                                                                      s lrdos ls lrdos ls lrdos ls} ld"ddddi SpecialFixis$ir$dk: This routine takes into account the special case when thedk9
                                                                      or

                                                                      is followed by a paragraph mark, rather thandk2 text. In that case, leave it -- its for spacing.dk; It expects the search string to end with a paragraph mark,dk; and inserts one after the replacement (can't insert "^pKQUOTE>0nonenonenoneBylinenonenone0nonenonenoneByline2

                                                                      none0nonenonenoneHeading 1

                                                                      

                                                                      0nonenonenoneHeading 2

                                                                      

                                                                      0nonenonenoneHeading 3

                                                                      

                                                                      0nonenonenoneHeading 4

                                                                      

                                                                      0nonenonenoneHeading 5
                                                                      
                                                                      0nonenonenoneHeading 6
                                                                      
                                                                      0nonenonenoneCodenonenone1

                                                                      
                                                                      noneNormal

                                                                      or
                                                                      none0nonenonenoneNormal Indent

                                                                      or
                                                                      none0

                                                                        
                                                                      noneList Bullet
                                                                    • none1
                                                                        
                                                                      noneList Bullet 2
                                                                    • none2
                                                                        
                                                                      noneList Bullet 3
                                                                    • none3
                                                                        
                                                                      noneList Bullet 4
                                                                    • none4
                                                                        
                                                                      noneList Bullet 5
                                                                    • none5
                                                                        
                                                                      noneList Number
                                                                    • none1
                                                                        
                                                                      noneList Number 2
                                                                    • none2
                                                                        
                                                                      noneList Number 3
                                                                    • none3
                                                                        
                                                                      noneList Number 4
                                                                    • none4
                                                                        
                                                                      noneList Number 5
                                                                    • none5
                                                                        
                                                                      noneList Continue

                                                                      or
                                                                      none1noneNoChgnoneList Continue 2

                                                                      or
                                                                      none2noneNoChgnoneList Continue 3

                                                                      or
                                                                      none3noneNoChgnoneList Continue 4

                                                                      or
                                                                      none4noneNoChgnoneList Continue 5

                                                                      or
                                                                      none5noneNoChgnoneTerm

                                                                      none1
                                                                      
                                                                      
                                                                      Term Cont
                                                                      none1
                                                                      
                                                                      noneTerm2
                                                                      none2
                                                                      
                                                                      
                                                                      Term2 Cont
                                                                      none2
                                                                      
                                                                      noneTerm3
                                                                      none3
                                                                      
                                                                      
                                                                      Term3 Cont
                                                                      none3
                                                                      
                                                                      noneNotes: This template must be in the same directory as the document you are converting. Open the file in Word and use File->Templates->Add to add this template to the list of templates in use. (If you want, you can have one copy in your templates directory and another in the directory containing the file. Its the one in your working directory that is opened in order to read the conversion table above.) The conversion table above is used by the doc2html conversion macro. Edit this table to control the HTML conversion. The table must be the first item in file. After opening this file, the macro does StartofDocument and then Select Column to select column one and search for a matching paragraph tag. Non-list paragraph styles are indicated by setting list-level to 0. or
                                                                      says to use if the paragraphs space-before property is 6 pts or more, and to use
                                                                      if it is less than 6 pts. This only applies to non-Heading, non-Title styles. List levels 1..5 indicate nesting level of the list. However, in Word you could use a Level 3 list at any time and get Level 3 indenting. In HTML, a Level 3 list without Levels 2 and 1 preceding it is the same as a Level 1 list. Similarly, a Level 3 list inside a Level 1 list is the same as Level 2. Etc. List Continue paragraph styles: NoChg means no change from current value. If in a bullet list, the list is
                                                                        ..
                                                                      . If in a numbered list, the list is
                                                                        ..
                                                                      . If a list has not already been started, a
                                                                        list is assumed. These paragraphs do not have the
                                                                      • tag, so there is no bullet or number. Term-definition paragraphs are sjTitlerdog" jTitle2dog dog ldogllRk Eliminate the paragraph markdois$ is$j gdoidoit ldo doidoit ldoTdR"dRgtdRi docTitle$ is$ddddidocName$dk! Returns name of current documentdis$ istatssgdidotIndex gis$j.didocName$ gis$idotIndexlddddidocDir$dk6 Returns the directory containing the current documentdidocDir$ istatsshddddiSavePosdk7 Saves the current position for later use by RestorePosdgjsaveLocsddddi RestorePosdk, Retur Michael Koch -"Nancy Stevenson Michael Koch ."Nancy Stevenson Michael Koch (/"Nancy Stevenson Michael Koch E0"Nancy Stevenson Michael Koch M1"Nancy Stevenson Michael Koch N2)IDG Books, Foster City Michael Koch p3)IDG Books, Foster City Michael Koch s4,Nancy StevensonIDG Books, Foster Cityf 35"Nancy Stevenson Michael Koch {6"Nancy Stevenson Michael Koch ܎7"Nancy Stevenson Michael Koch ܏8"Nancy Stevenson Michael Koch f9"Nancy Stevenson Michael Koch ܙ:,Nancy StevensonIDG Books, Foster Cityf 3;,Nancy StevensonIDG Books, Foster Cityf 3{<,Nancy StevensonIDG Books, Foster City& =,Nancy StevensonIDG Books, Foster City& >,Nancy StevensonIDG Books, Foster City& ?,Nancy StevensonIDG Books, Foster City& @,Nancy StevensonIDG Books, Foster CityF A,Nancy StevensonIDG Books, Foster CityF B,Nancy StevensonIDG Books, Foster CityF C,Nancy StevensonIDG Books, Foster CityF D,Nancy StevensonIDG Books, Foster CityF E,Nancy StevensonIDG Books, Foster CityF @F,Nancy StevensonIDG Books, Foster Cityf 3G,Nancy StevensonIDG Books, Foster CityF xH,Nancy StevensonIDG Books, Foster CityF I,Nancy StevensonIDG Books, Foster CityF J,Nancy StevensonIDG Books, Foster CityF K,Nancy StevensonIDG Books, Foster Cityf 3L,Nancy StevensonIDG Books, Foster Cityf M,Nancy StevensonIDG Books, Foster Cityf N,Nancy StevensonIDG Books, Foster Cityf O,Nancy StevensonIDG Books, Foster Cityf P,Nancy StevensonIDG Books, Foster Cityf TQ,Nancy StevensonIDG Books, Foster Cityf 3R,Nancy StevensonIDG Books, Foster Cityf 3S,Nancy StevensonIDG Books, Foster Cityf {T,Nancy StevensonIDG Books, Foster Cityf 3U,Nancy StevensonIDG Books, Foster Cityf V,Nancy StevensonIDG Books, Foster Cityf W,Nancy StevensonIDG Books, Foster Cityf X,Nancy StevensonIDG Books, Foster Cityf Y,Nancy StevensonIDG Books, Foster Cityf 3Z,Nancy StevensonIDG Books, Foster Cityf 3[,Nancy StevensonIDG Books, Foster Cityf \,Nancy StevensonIDG Books, Foster Cityf 3],Nancy StevensonIDG Books, Foster Cityf ^,Nancy StevensonIDG Books, Foster Cityf _,Nancy StevensonIDG Books, Foster Cityf `,Nancy StevensonIDG Books, Foster Cityf a,Nancy StevensonIDG Books, Foster Cityf b,Nancy StevensonIDG Books, Foster Cityf 3c,Nancy StevensonIDG Books, Foster Cityf 3d,Nancy StevensonIDG Books, Foster City e,Nancy StevensonIDG Books, Foster City f,Nancy StevensonIDG Books, Foster City ug,Nancy StevensonIDG Books, Foster City wh,Nancy StevensonIDG Books, Foster City Ei,Nancy StevensonIDG Books, Foster City Rj,Nancy StevensonIDG Books, Foster Cityf 3k,Nancy StevensonIDG Books, Foster Cityf 3l,Nancy StevensonIDG Books, Foster City Vm"Nancy Stevenson Michael Koch& ]5n"Nancy Stevenson Michael Koch& ](o"Nancy Stevenson Michael Koch& ]p"Nancy Stevenson Michael Koch& ]Tq"Nancy Stevenson Michael Koch& ]8r"Nancy Stevenson Michael Koch& ]Ss"Nancy Stevenson Michael Koch& ]st"Nancy Stevenson Michael Koch& ]Wu"Nancy Stevenson Michael Koch& \v"Nancy Stevenson Michael Koch& \w)Michael KochIDG Books, Foster City DRx"Nancy Stevenson Michael Kochf my,IDG Books, Foster CityNancy Stevenson z,IDG Books, Foster CityNancy Stevensonf m {,IDG Books, Foster CityJennifer Avelar&5C|,IDG Books, Foster CityJennifer Avelar&5&},IDG Books, Foster CityNancy Stevensonf l~)IDG Books, Foster City Michael Koch& ],IDG Books, Foster CityNancy Stevensonf l)IDG Books, Foster City Michael Koch& ],Nancy StevensonIDG Books, Foster City 44,IDG Books, Foster CityNancy Stevenson ku,IDG Books, Foster CityJennifer Avelar&5:"Michael KochNancy Stevenson& "Michael KochNancy Stevenson& "Michael KochNancy Stevenson& "Michael KochNancy Stevenson& "Michael KochNancy Stevenson& "Michael KochNancy Stevenns to the position saved with SavePos.dgzjsaveLocdgjsaveLocs ddddiEraseHeaderFooterInfodgdg lgNk Go to Header areadgn lgQRk Go to Header areadgdgdgNRk Go to Footer areadgdgdgddddi TemplatePath$ditPath$ jdisize gld#ii l$isizedRitp$ gyiildRgitp$j DOC2HTML.DOT ldoitPath$ itp$do*iDonedRTd&dk4 MsgBox msg$, "Current Global Templates and Add-Ins"ditPath$ jdRg+j4DOC2HTML.DOT needs to be added as a global template.rdoj  ls ls lrdos ls} ldRg׀dogllRk Eliminate the paragraph markdois$ gdo*iDonedRTdTdeDonedi docAuthor$ is$ddddi docTitle$dRk! Returns name of current documentdRk Look for title paragraphs(s)dRgdRgss jTitledRgps js ls lrdos ls ls lrdos ls} ldRg׀dogllRk Eliminate the paragraph markdois$ gdRTdRidoit ldR!idoit ldok" Concatenate additional paragraphsdoglRk Go to next paradog" jTitlerdog" jTitle2dog dog ldogllRk Eliminate the paragraph markdois$ is$j gdoidoit ldo doidoit ldoTdR"dRgtdRi docTitle$ is$ddddidocName$dk! Returns name of current documentdis$ istatssgdidotIndex gis$j.didocName$ gis$idotIndexlddddidocDir$dk6 Returns the directory containing the current documentdidocDir$ istatsshddddiSavePosdk7 Saves the current position for later use by RestorePosdgjsaveLocsddddi RestorePosdk, Returns to the position saved with SavePos.dgzjsaveLocdgjsaveLocs ddddiEraseHeaderFooterInfodgdg lgNk Go to Header areadgn lgQRk Go to Header areadgdgdgNRk Go to Footer areadgdgdgddddi TemplatePath$ditPath$ jdisize gld#ii l$isizedRitp$ gyiildRgitp$j DOC2HTML.DOT ldoitPath$ itp$do*iDonedRTd&dk4 MsgBox msg$, "Current Global Templates and Add-Ins"ditPath$ jdRg+j4DOC2HTML.DOT needs to be added as a global template.rdoj gl rdoj"Choose File:Templates, click Add, rdojand browse for the template.rdogl rdojThen click OK.dRgGldTeDonedi TemplatePath$ itPath$d dk DOC2HTML:dk# Creates a file called "XXXX.htm".dk; Where "XXXX" is the name of the currently active document.dk USAGE NOTESdk< * Things are easier to see if you open up this template anddk$ reduce it to a very small windowdk * To close the .HTM file:dk! 1. From File menu, choose CLOSEdk 2. Choose "Save changes YES" dk( 3. Choose "Text Onson& "Michael KochNancy Stevenson& "Michael KochNancy Stevenson& "Michael KochNancy Stevenson& "Michael KochNancy Stevenson& "Michael KochNancy Stevenson& "Michael KochNancy Stevenson& "Michael KochNancy Stevenson& "Michael KochNancy Stevenson& )IDG Books, Foster City Michael Koch ۓ)IDG Books, Foster City Michael Koch ܔ)IDG Books, Foster City Michael Koch ݕ)IDG Books, Foster City Michael Koch ,IDG Books, Foster CityJennily with Line Breaks"dk* 4. Unless particular spacing is desired,dk. a lot of documents should convert cleanlydk in a single pass.dk FEATURES:dk/ * Creates basic HTML structure (header & body)dk) * Creates HTML header information using:dk5 * Document properties Title & Author, if they existdk3 * Or using Title/Byline paragraphs, if they existdk; * Uses paragraph styles to create logical HTML format tagsdk@ * Table-driven conversion using editable table in this templatedk: * If paragraph has Bord insertdi SpecialFixj
                                                                          ^p^w
                                                                          j
                                                                            di SpecialFixj
                                                                              ^p

                                                                              j

                                                                                di SpecialFixj
                                                                                  ^p^w

                                                                                  j

                                                                                    di SpecialFixj

                                                                                    ^p

                                                                                    j

                                                                                    k --fix

                                                                                    sequencesddk/ Any
                                                                                    ^p combinations remaining are spacers.dk5 But
                                                                                    won't work after an
                                                                                  • . Replace with

                                                                                    dgus j
                                                                                    ^pRs j

                                                                                    ^psrdRs ls lrdRs ls ls lrdRs ls} lddiAddSpacingLinesddddiAddSpacingLinesdk* Add a para break before & after a

                                                                                    tagdgdgps j

                                                                                    s ls lrdRs ls ls lrdRs ls} ld!g׀dRgdRgdRgldRgdRgd"ddk# Add a para break after a

                                                                                     tagdgdgpsj
                                                                                    slslrdRslslslrdRsls}ld!g׀dRgdRgdRgd"ddkB Add a para break before a heading tag 

                                                                                    ..

                                                                                    or

                                                                                    dgdgps j \]s ls lrdRs ls ls lrdRs ls} ld!g׀dRgdRgdRgldRgd"ddk+ Add a para break before a
                                                                                    tagdgdgps j
                                                                                    s ls lrdRs ls ls lrdRs ls} ld!g׀dRgdRgdRgl dRgd"ddk# Move
                                                                                    tags to end of prev linedgdgps j^p
                                                                                    s ls lrdRs ls ls lrdRs ls} ld!g׀dRgj
                                                                                    dRgdRgps j
                                                                                    s lrdos ls lrdos ls lrdos ls} ld"ddddi SpecialFixis$ir$dk: This routine takes into account the special case when thedk9
                                                                                    or

                                                                                    is followed by a paragraph mark, rather thandk2 text. In that case, leave it -- its for spacing.dk; It expects the search string to end with a paragraph mark,dk; and inserts one after the replacement (can't insert "^p"!)dgdgps is$s ls lrdRs ls ls lrdRs ls} ld!g׀dRgj\seljtempdRgdRgg l dok0 Not at a paragraph mark. This is not a spacer.dok# Remove it, but preserve whitespacedogzjtempdogps j^wRk! Find whitespace in the selectiondog׀dogmok Save whitespacedogzjtempRk Replace original selection,dogir$ok removing the
                                                                                    or

                                                                                    tagdogdognok Reinsert whitespacedo dogir$dogdoTdRTdRgps is$s ls lrdos ls ls lrdos ls} ld"ddddi ProcessTextdRk Process Special CharactersdRdRk" TURN OFF SUBSTITUTIONS IN ITALICSdRk/ THAT MEANS HTML CAN BE EMBEDDED, IF ITALICIZEDdRgtdRgqs% ldRdRk ampersand-&dRi FixNonCodej&j&dRdRk dRi FixNonCodej>j>dRdRk quote-"dRi FixNonCodegl"j"dRdRk Non-breaking spacedRi FixNonCodej^sj dRdRk+ Process Bold, Italic, & Strikethrough TextdRiCleanParagraphMarksRk* Remove char formatting in paragraph marksdRgtdRgqs$ ldRiFixNonHeadingTextjj dRgtdRgqs% ldRiFixNonHeadingTextjjdRgtdRgqs ldRiFixNonHeadingTextjjddddiProcessGraphicsdRgdRk Search For graphicsdRgps j^gs ls lrdos ls ls lrdos ls} ldR!g׀dogdR"ddddiCleanParagraphMarksdRk1 Remove font characteristics from paragraph marksdRgtdRgydRgvs( ls# lrdos ls ls lrdos' ls] ls; lrdos$ ls% ldRgus j^ps j^psrdos ls lrdos ls ls lrdos ls} lddddiFixSectionBreaksdgdgps j^bs ls lrdRs ls ls lrdRs ls} ld!g׀dRgdRiAddLinej

                                                                                    ^pdRgd"ddddi FixNonCodeiold$inew$dk- Do the conversion, except in Code paragraphsdgdgps iold$s ls lrdRs ls ls lrdRs ls} ld!g׀dRis$ g"dRgis$l jCodedoginew$dRTdRgd"ddddiFixNonHeadingTextibeginIt$iendIt$dk9 Do the conversion, except in Heading or Title paragraphsdgdgps js ls lrdRs ls ls lrdRs ls} ld!g׀dRis$ g"dRngis$l jHeadingrdRgis$l jTitledogj \EndOfSeljEndPointdog.dogzj \StartOfSeldog.Rk' In case there is something ahead of usdogibeginIt$dogzjEndPointdogs jEndPoints dok% Necessary to fix Word bug. Where itdok" finds the bookmark as bold, next.dog.dogiendIt$dRTdRgd"ddddiProcessParagraphsdgdi laststartTag$ jdi lastEndTag$ jdi lastListLevel ld!g܁dRg" jHTML*iNextTagdRdRk Horizontal Rule ProcessingdRg$ ldoi AddIndenti listLeveldoiAddLinej
                                                                                    Rk Top Border => Horiz. RuledRTdRi Style2Tag$dRdRk* Special Title Processing (Title & Title2)dRni startTag$ i lastStartTag$rdRiendTag$ j

                                                                                    doiAddj
                                                                                    do*iNextTagdRTdRdRk Finish old tagdRi lastEndTag$ jdoi AddIndenti lastListLeveldoiAddLinei lastEndTag$dRTdRdRk List ProcessingdRi listEndTag$ jNoChgdok2 If not already in a list at this level, start onedok, This happens for "List Continue" paragraphsdoni listTagStack$i listLevel jdoi listStartTag$ j
                                                                                      doi listEndTag$ j
                                                                                    doi listTagStack$i listLevel i listEndTag$doTdRTdRi listLeveli lastListLeveldok Start new listdoi AddIndenti listLeveldoiAddi listStartTag$dR k listLevel <= lastListLeveldok Close all deeper-level listsdo#ii i lastListLevel$i listLevell%ldoi AddIndentiidoi listTagStack$ii jdoiAddLinei listTagStack$iidoi listTagStack$ii jdoTdo&iidok> If still in a list, check list type to make sure its the samedoni listLevel lrdoi listEndTag$ jNoChgrdoi listTagStack$i listLevel i listEndTag$dok! Close old list and start new onedoi listTagStack$i listLevel jdoi AddIndenti lastListLeveldoiAddLinei listTagStack$i listLeveldoTdoi listStartTag$ jdoi AddIndenti listLeveldoiAddLinei listStartTag$doTdoi listTagStack$i listLevel i listEndTag$doTdRTddRk Special Tag ProcessingdR/ipFormat4gdR>ipFormatdRis$ ipFormatsok="3 pt", or "12 pt", etc.dRispaceBef ggis$gis$j ldRni startTag$ j

                                                                                    or
                                                                                    dok) Tag to use depends on space-before valuedonispaceBefi addSpaceLimitdoi startTag$ j

                                                                                    do doi startTag$ j
                                                                                    doTdRTdRni startTag$ j

                                                                                    rdRi startTag$ j
                                                                                    dok+ Add an extra line, when neederTop() true, its preceded by


                                                                                    dk2 * Handles nested lists. Indents to show nesting.dk * Convert NL's to breaksdk1 * Convert non-heading bold & italic text styles dk (to logical format tags)dk. * Convert strikethrough text to formatdk; * Converts first tab or NL in a start-definition paragraphdk: to
                                                                                    ...
                                                                                    . (controlled by the value of "Break Tag"dk in the table.dk TODO:dk4 * Find out what the right header tag is for author.dkE One authoring tool used "", but Netscape is died for leadingdoisn$ g"donispaceBefi addSpaceLimitrdogisn$l jHeadingrdoisn$ jTitlerdoisn$ jTitle2rdoisn$ jSubtitlerdoisn$ jSummaryrdoisn$ jBylinedoiAddLinej

                                                                                    doTdRTdRi breakTag$ j

                                                                                    dok2 Replace first tab or NL in paragraph w/ break tagdogzj\Parank Restrict to curr paragraphdok Replace first tab.dogus j^ts i breakTag$rdoss ls lrdos ls ls lrdos ls} ldog׀dok" Tab not found. Replace first NL.dogus j^ls i breakTag$rdoss ls lrdos ls ls lrdos ls} ldoTdok- Return To original position at start of paradogzj\ParadogdRTdRdRk Start new tagdRi AddIndenti listLeveldRiAddi startTag$Rk Noop if nulldRiConvertNewlinesdeNextTagdRgi specialTag$dRgdRi lastStartTag$ i startTag$dRi lastEndTag$ iendTag$dRi lastListLevel i listLeveldRni listLevellrdRi listEndTag$ jNoChgdoi listTagStack$i listLevel i listEndTag$dRTd"ddddi IndentCodedRgdRgtdRgss jCodedRgps js ls lrdos ls ls lrdos ls} ldR!g׀dogdogj dogzj\Paradogdogps js ls lrdos ls ls lrdos ls} ldR"ddddiConvertNewlinesdis$ j^piIndentSpacing$i listLevelj
                                                                                    dgzj\Paradgus j^lrdos is$srdos ls ls lrdos ls ls lrdos} lddddi Style2Tag$dis$ g"dgbiconversionWindow$dgdgdgps is$s ls lrdRs ls ls lrdRs ls} ldg׀dRi startTag$ iGetNextCellVal$dRiendTag$ iGetNextCellVal$dRi listLevel giGetNextCellVal$dRi listStartTag$ iGetNextCellVal$dRi listEndTag$ iGetNextCellVal$dRi breakTag$ iGetNextCellVal$d dRiresponse g+jUndefined style: is$rdonj. Using default tags. rdonj7To eliminate this message, put an entry in DOC2HTML.DOTrdnjDOC2HTMLldRiresponse lgGldRi startTag$ j

                                                                                    dRiendTag$ jdRkB Note: Leave current list level and list start/end tags unchanged.dTdeDonedgbi workWindow$ddddiGetNextCellVal$dgπdis$ gdis$ jnoneis$ jdiGetNextCellVal$ is$ddddiAddStartStructuredgdiAddLinejdiAddLinejdi ProcessHeaderdiAddLinejdiAddLinejRk Extra para breakdkAddLine("")diAddLinejddddiAddEndStructuredgdgRk (Don't use AddLine here)ddk Close any open listsd#ii l$l%ldRi listTagStack$ii jdoi AddIndentiidoiAddLinei listTagStack$iidoi listTagStack$ii jdRd&iiddiAddLinejdiAddLinejddddi ProcessHeaderdiSavePosdit$ i docTitle$dia$ i docAuthor$di RestorePosdit$ jiAddLinejit$jdk< Is the right tag? Its showing up in the document,dk' even though its defined in the header.dk8 If a$ <> "" Then AddLine("" + a$ + "")ddddiAdditag$dgitag$dgi specialTag$ddddiAddLineitag$dk Adds a tag line dk& Does not change existing para's styledgitag$dgdgdgi specialTag$dgddddi AddIndentileveldilevelldR#ii l$ileveldogiindent$dR&iidTddddiIndentSpacing$ileveldis$ jdilevelldR#ii l$ileveldois$ is$iindent$dR&iidTdiIndentSpacing$ is$ddddiGetStatsdgVs.RkUpdate doc statsd>istatsddddi docAuthor$dk! Returns name of current documentdk, WORD BUG: "stats.Author" = "undefined fielddk3 EVEN THOUGH: When saving, the syntax is recognizeddk- ("Author" is automatically init-capped)dis$ istatsskRk Workarounddis$ j*iDoneddk. Look for "byline" or "Byline" paragraph styledgdgejbyline jdRgss jbylinedRgps js ls lrdos ls ls lrdos ls} ldRg׀dogllRk Eliminate the paragraph markdois$ gdo*iDonedRTdTdgejByline jdRgss jBylinedRgps js ls lrdosgl rdoj"Choose File:Templates, click Add, rdojand browse for the template.rdogl rdojThen click OK.dRgGldTeDonedi TemplatePath$ itPath$d  g o 5678_`ijpqTT&r5666dwew*-67FXYAQRSTUVWZ_r789:uauD[UZ!.:IV`afkprw|4[ jRR4[ jRR4[ jRR4[ jRRl vX #4lX vX # $sU ldRk* .ReadOnly = 1 was a nice idea, but becamedRk5 a nuisance -- cannot easily edit the table and retrydiconversionWindow$ g;dgl lHdglHRk 72 points, 1 inchdg2idLeftl idTopidHeightl k Underneath work windowddk Save HTM versiondgbi firstWindow$di pathname$ icurrDir$j\ifn$j.htmdgTs i pathname$s ldg2idLeftl idTopldi workWindow$ g;ddk Re-open the original filedgPs icurrDir$j\ifn$j.docdg3idWidthidHeightdg2idLeftidTopdgbi workWindow$ !&+-27<=EV[]bglmw|4[ jRR4[ jRR4[ jRR4[ jRR4[ jRR4[l vX #*  %*/0:?EGLQVW\afhqx}~ jRR4[ jRR4[ jRR4[ jRR4[ jRR4[ l vX #*  #%*056DINPU[jRR4[ jRR4[ jRR4[ jRR4[ jRR4[ jl vX #*mentdidocDir$ istatsshddddiSavePosdk7 Saves the current position for later use by RestorePosdgjsaveLocsddddi RestorePosdk, Returns to the position saved with SavePos.dgzjsaveLocdgjsaveLocs ddddiEraseHeaderFooterInfodgdg lgNk Go to Header areadgn lgQRk Go to Header areadgdgdgNRk Go to Footer areadgdgdgddddi TemplatePath$ditPath$ jdisize gld#ii l$isizedRitp$ gyiildRgitp$j DOC2HTML.DOT ldoitPath$ itp$do*iDone}HGfer Avelar&4m,IDG Books, Foster CityJennifer Avelar&42IDG Books, Foster CityIDG Books Foster City&k_,IDG Books, Foster CityJennifer Avelar&4,IDG Books, Foster CityJennifer Avelar&4͛,IDG Books, Foster CityJennifer Avelar&4ٜ,IDG Books, Foster CityJennifer Avelar&4,IDG Books, Foster CityNancy Stevenson e,IDG Books, Foster CityJennifer Avelar d)IDG Books WorldwideJennifer Avelar&4%IDG Books Worldwide Marilyn Kyd Henry Abrecht'IDG Books Worldwide Henry Abrechtfp'Henry AbrechtIDG Books Worldwideu'IDG Books Worldwide Henry AbrechtfՃ'IDG Books Worldwide Henry Abrechtfy%IDG Books Worldwide Julia KellyF#/%Julia KellyIDG Books Worldwidel%Julia KellyIDG Books Worldwidei%IDG Books Worldwide Julia Kelly%IDG Books Worldwide Marilyn Kyd#u%IDG Books Worldwide Julia Kelly%IDG Books Worldwide Julia Kelly%IDG Books Worldwide Julia Kelly%IDG Books Worldwide Julia Kelly%IDG Books Worldwide Julia Kelly"%IDG Books Worldwide Julia Kelly%IDG Books Worldwide Julia Kelly%IDG Books Worldwide Julia Kelly%IDG Books Worldwide Julia Kelly%IDG Books Worldwide Julia Kelly#%IDG Books Worldwide Julia KellyB%IDG Books Worldwide Julia Kelly%IDG Books Worldwide Julia Kelly%IDG Books Worldwide Julia Kelly$%IDG Books Worldwide Julia Kelly%IDG Books Worldwide Julia Kelly%IDG Books Worldwide Julia Kelly&%IDG Books Worldwide Julia Kelly%IDG Books Worldwide Julia Kelly%IDG Books Worldwide Julia KellyWJulia Kelly Marilyn Kyd#%IDG Books Worldwide Julia KellyfJ%Julia KellyIDG Books Worldwide%IDG Books Worldwide Julia KellyF'%Julia KellyIDG Books Worldwide[%IDG Books Worldwide Julia Kellyfz%IDG Books Worldwide Julia Kellyfz%IDG Books Worldwide Julia Kellyf{%IDG Books Worldwide Julia Kellyf{%IDG Books Worldwide Julia K[`aoty{ RR4[ jRR4[ jRR4[ jRR4[ jRR4[ jRRl vX #*!&+-28=>LQVX]chiw|4[ jRR4[ jRR4[ jRR4[ jRR4[ jRR4[l vX #*#%*056FRWY^dijz jRR4[ jRR4[ jRR4[ jRR4[ jRR4[ l vX #*    ! " - 2 7 9 > D I J P U Z \ i o t u jRR4[ jRR4[ jRR4[ jRR4[ jRR4[ jl vX #* = o p ~/TRR4[ jRR!!!!!!!!!!!!( ""4lX vX #l vX #(K@Normalxa ,@, Heading 1h U]ck(@( Heading 2U]c(@( Heading 3 <Uc&@& Heading 4xVc"A@"Default Paragraph FontZ0@Z List Bullet@ h 4h*>@*Title < U]c kOTitle2h6@"h List Bullet 2K  4hP^E@2^List Continue 2@  4h.\:@B\ List Number 2@  4h.\7@R\ List Bullet 3@ 8 4h\8@b\ List Bullet 4@  4h\9@r\ List Bullet 5@  4h^F@^List Continue 3@ 8 4h.^G@^List Continue 4@  4h.bD@b List ContinueE h< 4h. @ Header ! @ Footer !"@" Normal Indenth^H@^List Continue 5@  4h.@-@@ Macro Text! ` @ ]a @TOC 1 ! O Table Text!cZ1@"Z List Number@" h 4h.\;@2\ List Number 3@# 8 4h.\<@B\ List Number 4@$  4h.\=@R\ List Number 5@%  4h.*Ob*Term2&<]Oar Term2 Cont'dk DOC2HTML:dk# Creates a file called "XXXX.htm".dk; Where "XXXX" is the name of the currently active document.dk USAGE NOTESdk< * Things are easier to see if you open up this template anddk$ reduce it to a very small windowdk * To close the .HTM file:dk! 1. From File menu, choose CLOSEdk 2. Choose "Save changes YES" dk( 3. Choose "Text Only with Line Breaks"dk* 4. Unless particular spacing is desired,dk. a lot of documents should convert cleanlydk in a single pass.dk FEATURES:dk/ * Creates basic HTML structure (header & body)dk) * Creates HTML header information using:dk5 * Document properties Title & Author, if they existdk3 * Or using Title/Byline paragraphs, if they existdk; * Uses paragraph styles to create logical HTML format tagsdk@ * Table-driven conversion using editable table in this templatedk: * If paragraph has BorderTop() true, its preceded by


                                                                                    dk2 * Handles nested lists. Indents to show nesting.dk * Convert NL's to breaksdk1 * Convert non-heading bold & italic text styles dk (to logical format tags)dk. * Convert strikethrough text to formatdk; * Converts first tab or NL in a start-definition paragraphdk: to
                                                                                    ...
                                                                                    . (controlled by the value of "Break Tag"dk in the table.dk TODO:dk4 * Find out what the right header tag is for author.dkE One authoring tool used "", but Netscape is displaying it.dk7 * Convert contained bmp files to Gif files and includedk * Convert tablesdk8 * Convert help file bitmap references to gif referencesdk$ and convert bmp files to Gif filesdk* * Convert help file links to HTML anchorsdkB * Read "addSpaceLimit" and text-substitution values from templatedk' (at the moment, they are hard-coded)dk RESTRICTIONS:dk< * A bug in Word prevents reading the Property sheet for thedkB Author value. For some reason, the reference to "stats.Author"dkA fails, even though the to reference to "stats.Title" succeeds.dkB (stats is the DocumentStatistics record). Workaround is to usedk4 the .LastSavedBy value, which is usually correct.dd/0istats4gNd/0i workWindow$d/0iconversionTableFile$d/0iconversionWindow$d/0i specialTag$d/0i startTag$d/0iendTag$d/0i listLeveld/0i listStartTag$d/0i listEndTag$d/0i listTagStack$ld/0i breakTag$d/0iindent$Rk Indent for nested listsd/0i addSpaceLimitdRk8 If paragraph's space-before value is greater than this,dRk9 Then add and extra line for spacing. (Using 5, for now)ddiInitdk Setup output filedicurrDir$ idocDir$dicurrDir$ jdRg+j&Cuellyf{%IDG Books Worldwide Julia Kellyf{%IDG Books Worldwide Julia Kellyfz%IDG Books Worldwide Marilyn Kyd%IDG Books Worldwide Marilyn Kyd%IDG Books Worldwide Marilyn Kyd%IDG Books Worldwide Julia Kellyfz%IDG Books Worldwide Marilyn Kyd%IDG Books Worldwide Julia Kellyfz%IDG Books Worldwide Julia Kellyfz%IDG Books Worldwide Julia KellyZ%Julia KellyIDG Books WorldwideFr%IDG Books Worldwide Julia Kellyfz%IDG Books Worldwide Julia Kellyf{%Julia KellyIDG Books WorldwideFr%IDG Books Worldwide Julia Kellyfz%IDG Books Worldwide Julia Kellyfz%IDG Books Worldwide Julia Kellyf{%IDG Books Worldwide Marilyn Kyd%IDG Books Worldwide Julia Kellyfz%IDG Books Worldwide Julia Kellyfz%IDG Books Worldwide Julia Kellyf{%IDG Books Worldwide Julia Kellyf{%IDG Books Worldwide Julia Kellyf{ %IDG Books Worldwide Julia Kellyf{ %IDG Books Worldwide Julia Kellyf{%IDG Books Worldwide Marilyn Kyd%IDG Books Worldwide Julia Kellyfz%IDG Books Worldwide Julia Kellyfz%IDG Books Worldwide Julia Kellyfz%IDG Books Worldwide Julia Kellyfz%IDG Books Worldwide Julia Kellyfz%IDG Books Worldwide Julia KellyG%IDG Books Worldwide Julia Kellyfz%IDG Books Worldwide Julia Kellyf{%IDG Books Worldwide Julia Kellyfz%IDG Books Worldwide Julia Kellyf{ %Julia KellyIDG Books WorldwideFrm%Julia KellyIDG Books Worldwide&l%Julia KellyIDG Books Worldwide&j%Julia KellyIDG Books Worldwide&j%Julia KellyIDG Books Worldwide&k%Julia KellyIDG Books Worldwide&j%Julia KellyIDG Books Worldwide&j%Julia KellyIDG Books Worldwide&j%Julia KellyIDG Books Worldwide&j%Julia KellyIDG Books Worldwide&j%Julia KellyIDG Books Worldwide&k%Julia KellyIDG Books Worldwide&j%Julia KellyIDG Books Worldwide&j%Julia KellyIDG Books Worldwide&j%Julia KellyIDG Books Worldwide&jsplaying it.dk7 * Convert contained bmp files to Gif files and includedk * Convert tablesdk8 * Convert help file bitmap references to gif referencesdk$ and convert bmp files to Gif filesdk* * Convert help file links to HTML anchorsdkB * Read "addSpaceLimit" and text-substitution values from templatedk' (at the moment, they are hard-coded)dk RESTRICTIONS:dk< * A bug in Word prevents reading the Property sheet for thedkB Author value. For some reason, the reference to "stats.Author"dkA fails, even though the to reference to "stats.Title" succeeds.dkB (stats is the DocumentStatistics record). Workaround is to usedk4 the .LastSavedBy value, which is usually correct.dd/0istats4gNd/0i workWindow$d/0iconversionTableFile$d/0iconversionWindow$d/0i specialTag$d/0i startTag$d/0iendTag$d/0i listLeveld/0i listStartTag$d/0i listEndTag$d/0i listTagStack$ld/0i breakTag$d/0iindent$Rk Indent for nested listsd/0i addSpaceLimitdRk8 If paragraph's space-before value is greater than this,dRk9 Then add andddk' Set up a style tag for processed linesdiindent$ j Rk 4 space indent for nested listsdi addSpaceLimit ldi specialTag$ jHTMLdgs i specialTag$s{ jNormals,dgs ls lrdRs lsD ldgs( ls# ls' lrdRs ls ls lrdRs] ls; ls$ ls% lddddiMAINdiGetStatsdiInitddi ProcessTextRk/ Before adding structure, to handle "<" and ">"di IndentCodediFixSectionBreaksdiAddStartStructurediProcessParagraphsdiProcessGraphicsdiAddEndStructurediCleanUpSpacingdiEraseHeaderFooterInfoddk) Leave the newly converted file open opendk- Leave conversion table open for adjustments.dk Activate conversionWindow$dk FileClose 2ddddiCleanUpSpacingdk PRETTY PRINTINGdk; List Continue styles (endList tag="NoChg") have
                                                                                      addeddk< when they are not already part of a list. This makes extradk3 spacing, because they also start with
                                                                                      or

                                                                                      .dk This routine cleans that up.dkA Look for

                                                                                        followed by paragraph mark (^p) and
                                                                                        (or

                                                                                        ).dk2 --Also allow for indentation (whitespace or ^w) dk before the
                                                                                        or

                                                                                        .dk. (This fast fix messes up the indentation.)di SpecialFixj

                                                                                          ^p
                                                                                          j
                                                                                            Rk search string, what to insertdi SpecialFixj
                                                                                              ^p^w
                                                                                              j
                                                                                                di SpecialFixj
                                                                                                  ^p

                                                                                                  j

                                                                                                    di SpecialFixj
                                                                                                      ^p^w

                                                                                                      j

                                                                                                        di SpecialFixj

                                                                                                        ^p

                                                                                                        j

                                                                                                        k --fix

                                                                                                        sequencesddk/ Any
                                                                                                        ^p combinations remaining are spacers.dk5 But
                                                                                                        won't work after an
                                                                                                      • . Replace with

                                                                                                        dgus j
                                                                                                        ^pRs j

                                                                                                        ^psrdRs ls lrdRs ls ls lrdRs ls} lddiAddSpacingLinesddddiAddSpacingLinesdk* Add a para break before & after a

                                                                                                        tagdgdgps j

                                                                                                        s ls lrdRs ls ls lrdRs ls} ld!g׀dRgdRgdRgldRgdRgd"ddk# Add a para break after a

                                                                                                         tagdgdgpsj
                                                                                                        slslrdRslslslrdRsls}ld!g׀dRgdRgdRgd"ddkB Add a para break before a heading tag 

                                                                                                        ..

                                                                                                        or

                                                                                                        dgdgps j \]s ls lrdRs ls ls lrdRs ls} ld!g׀dRgdRgdRgldRgd"ddk+ Add a para break before a
                                                                                                        tagdgdgps j
                                                                                                        s ls lrdRs ls ls lrdRs ls} ld!g׀dRgdRgdRgl dRgd"ddk# Move
                                                                                                        tags to end of prev linedgdgps j^p
                                                                                                        s ls lrdRs ls ls lrdRs ls} ld!g׀dRgj
                                                                                                        dRgdRgps j
                                                                                                        s lrdos ls lrdos ls lrdos ls} ld"ddddi SpecialFixis$ir$dk: This routine takes into account the special case when thedk9
                                                                                                        or

                                                                                                        is followed by a paragraph mark, rather thandk2 text. In that case, leave it -- its for spacing.dk; It expects the search string to end with a paragraph mark,dk; and inserts one after the replacement (can't insert "^p"!)dgdgps is$s ls lrdRs ls ls lrdRs ls} ld!g׀dRgj\seljtempdRgdRgg l dok0 Not at a paragraph mark. This is not a spacer.dok# Remove it, but preserve whitespacedogzjtempdogps j^wRk! Find whitespace in the selectiondog׀dogmok Save whitespacedogzjtempRk Replace original selection,dogir$ok removing the
                                                                                                        or

                                                                                                        tagdogdognok Reinsert whitespacedo dogir$dogdoTdRTdRgps is$s ls lrdos ls ls lrdos ls} ld"ddddi ProcessTextdRk Process Special CharactersdRdRk" TURN OFF SUBSTITUTIONS IN ITALICSdRk/ THAT MEANS HTML CAN BE EMBEDDED, IF ITALICIZEDdRgtdRgqs% ldRdRk ampersand-&dRi FixNonCodej&j&dRdRk dRi FixNonCodej>j>dRdRk quote-"dRi FixNonCodegl"j"dRdRk Non-breaking spacedRi FixNonCodej^sj dRdRk+ Process Bold, Italic, & Strikethrough TextdRiCleanParagraphMarksRk* Remove char formatting in paragraph marksdRgtdRgqs$ ldRiFixNonHeadingTextjj dRgtdRgqs% ldRiFixNonHeadingTextjjdRgtdRgqs ldRiFixNonHeadingTextjjddddiProcessGraphicsdRgdRk Search For graphicsdRgps j^gs ls lrdos ls ls lrdos ls} ldR!g׀dogdR"ddddiCleanParagraphMarksdRk1 Remove font characteristics from paragraph marksdRgtdRgydRgvs( ls# lrdos ls ls lrdos' ls] ls; lrdos$ ls% ldRgus j^ps j^psrdos ls lrdos ls ls lrdos ls} lddddiFixSectionBreaksdgdgps j^bs ls lrdRs ls ls lrdRs ls} ld!g׀dRgdRiAddLinej

                                                                                                        ^pdRgd"ddddi FixNonCodeiold$inew$dk- Do the conversion, except in Code paragraphsdgdgps iold$s ls lrdRs ls ls lrdRs ls} ld!g׀dRis$ g"dRgis$l jCodedoginew$dRTdRgd"ddddiFixNonHeadingTextibeginIt$iendIt$dk9 Do the conversion, except in Heading or Title paragraphsdgdgps js ls lrdRs ls ls lrdRs ls} ld!g׀dRis$ g"dRngis$l jHeadingrdRgis$l jTitledogj \EndOfSeljEndPointdog.dogzj \StartOfSeldog.Rk' In case there is something ahead of usdogibeginIt$dogzjEndPointdogs jEndPoints dok% Necessary to fix Word bug. Where itdok" finds the bookmark as bold, next.dog.dogiendIt$dRTdRgd"ddddiProcessParagraphsdgdi laststartTag$ jdi lastEndTag$ jdi lastListLevel ld!g܁dRg" jHTML*iNextTagdRdRk Horizontal Rule ProcessingdRg$ ldoi AddIndenti listLeveldoiAddLinej
                                                                                                        Rk Top Border => Horiz. RuledRTdRi Style2Tag$dRdRk* Special Title Processing (Title & Title2)dRni startTag$ i lastStartTag$rdRiendTag$ j

                                                                                                        doiAddj
                                                                                                        do*iNextTagdRTdRdRk Finish old tagdRi lastEndTag$ jdoi AddIndenti lastListLeveldoiAddLinei lastEndTag$dRTdRdRk List ProcessingdRi listEndTag$ jNoChgdok2 If not already in a list at this level, start onedok, This happens for "List Continue" paragraphsdoni listTagStack$i listLevel jdoi listStartTag$ j
                                                                                                          doi listEndTag$ j
                                                                                                        doi listTagStack$i listLevel i listEndTag$doTdRTdRi listLeveli lastListLeveldok Start new listdoi AddIndenti listLeveldoiAddi listStartTag$dR k listLevel <= lastListLeveldok Close all deeper-level listsdo#ii i lastListLevel$i listLevell%ldoi AddIndentiidoi listTagStack$ii jdoiAddLinei listTagStack$iidoi listTagStack$ii jdoTdo&iidok> If still in a list, check list type to make sure its the samedoni listLevel lrdoi listEndTag$ jNoChgrdoi listTagStack$i listLevel i listEndTag$dok! Close old list and start new onedoi listTagStack$i listLevel jdoi AddIndenti lastListLeveldoiAddLinei listTagStack$i listLeveldoTdoi listStartTag$ jdoi AddIndenti listLeveldoiAddLinei listStartTag$doTdoi listTagStack$i listLevel i listEndTag$doTdRTddRk Special Tag ProcessingdR/ipFormat4gdR>ipFormatdRis$ ipFormatsok="3 pt", or "12 pt", etc.dRispaceBef ggis$gis$j ldRni startTag$ j

                                                                                                        or
                                                                                                        dok) Tag to use depends on space-before valuedonispaceBefi addSpaceLimitdoi startTag$ j

                                                                                                        do doi startTag$ j
                                                                                                        doTdRTdRni startTag$ j

                                                                                                        rdRi startTag$ j
                                                                                                        dok+ Add an extra line, when needed for leadingdoisn$ g"donispaceBefi addSpaceLimitrdogisn$l jHeadingrdoisn$ jTitlerdoisn$ jTitle2rdoisn$ jSubtitlerdoisn$ jSummarydoiAddLinej

                                                                                                        doTdRTdRi breakTag$ j

                                                                                                        dok2 Replace first tab or NL in paragraph w/ break tagdogzj\Parank Restrict to curr paragraphdok Replace first tab.dogus j^ts i breakTag$rdoss ls lrdos ls ls lrdos ls} ldog׀dok" Tab not found. Replace first NL.dogus j^ls i breakTag$rdoss ls lrdos ls ls lrdos ls} ldoTdok- Return To original position at start of paradogzj\ParadogdRTdRdRk Start new tagdRi AddIndenti listLeveldRiAddi startTag$Rk Noop if nulldRiConvertNewlinesdeNextTagdRgi specialTag$dRgdRi lastStartTag$ i startTag$dRi la extra line for spacing. (Using 5, for now)ddiInitdk Setup output filedicurrDir$ idocDir$dicurrDir$ jdRg+j&Current document has not been saved. gl rdonj/Please save it and make sure that DOC2HTML.DOT rdonjis in the same directory.dRgGldTdifn$ idocName$di firstWindow$ g;dgD lgDlRk go to Window statedidWidth gdidHeight gdidLeft gFdidTop gEddk Open conversion tablediconversionTableFile$ i templatePath$dgPs iconversionTableFile$sU ldRk* .ReadOnly = 1 was a nice idea, but becamedRk5 a nuisance -- cannot easily edit the table and retrydiconversionWindow$ g;dgl lHdglHRk 72 points, 1 inchdg2idLeftl idTopidHeightl k Underneath work windowddk Save HTM versiondgbi firstWindow$di pathname$ icurrDir$j\ifn$j.htmdgTs i pathname$s ldg2idLeftl idTopldi workWindow$ g;ddk Re-open the original filedgPs icurrDir$j\ifn$j.docdg3idWidthidHeightdg2idLeftidTopdgbi workWindow$ddk' Set up a style tag for processed linesdiindent$ j Rk 4 space indent for nested listsdi addSpaceLimit ldi specialTag$ jHTMLdgs i specialTag$s{ jNormals,dgs ls lrdRs lsD ldgs( ls# ls' lrdRs ls ls lrdRs] ls; ls$ ls% lddddiMAINdiGetStatsdiInitddi ProcessTextRk/ Before adding structure, to handle "<" and ">"di IndentCodediFixSectionBreaksdiAddStartStructurediProcessParagraphsdiProcessGraphicsdiAddEndStructurediCleanUpSpacingdiEraseHeaderFooterInfoddk) Leave the newly converted file open opendk- Leave conversion table open for adjustments.dk Activate conversionWindow$dk FileClose 2ddddiCleanUpSpacingdk PRETTY PRINTINGdk; List Continue styles (endList tag="NoChg") have
                                                                                                          addeddk< when they are not already part of a list. This makes extradk3 spacing, because they also start with
                                                                                                          or

                                                                                                          .dk This routine cleans that up.dkA Look for

                                                                                                            followed by paragraph mark (^p) and
                                                                                                            (or

                                                                                                            ).dk2 --Also allow for indentation (whitespace or ^w) dk before the
                                                                                                            or

                                                                                                            .dk. (This fast fix messes up the indentation.)di SpecialFixj

                                                                                                              ^p
                                                                                                              j
                                                                                                                Rk search string, what to insertdi SpecialFixj
                                                                                                                  ^p^w
                                                                                                                  j
                                                                                                                    di SpecialFixj
                                                                                                                      ^p

                                                                                                                      j

                                                                                                                        di SpecialFixj
                                                                                                                          ^p^w

                                                                                                                          j

                                                                                                                            di SpecialFixj

                                                                                                                            ^p

                                                                                                                            j

                                                                                                                            k --fix

                                                                                                                            sequencesddk/ Any
                                                                                                                            ^p combinations remaining are spacers.dk5 But
                                                                                                                            won't work after an
                                                                                                                          • . Replace with

                                                                                                                            dgus j
                                                                                                                            ^pRs j

                                                                                                                            ^psrdRs ls lrdRs ls ls lrdRs ls} lddiAddSpacingLinesddddiAddSpacingLinesdk* Add a para break before & after a

                                                                                                                            tagdgdgps j

                                                                                                                            s ls lrdRs ls ls lrdRs ls} ld!g׀dRgdRgdRgldRgdRgd"ddk# Add a para break after a

                                                                                                                             tagdgdgpsj
                                                                                                                            slslrdRslslslrdRsls}ld!g׀dRgdRgdRgd"ddkB Add a para break before a heading tag 

                                                                                                                            ..

                                                                                                                            or

                                                                                                                            dgdgps j \]s ls lrdRs ls ls lrdRs%Julia KellyIDG Books Worldwide&j%IDG Books Worldwide Marilyn KydJulia Kelly Marilyn Kyd%Julia KellyIDG Books Worldwide\%Julia KellyIDG Books Worldwide\%Julia KellyIDG Books Worldwide\%Julia KellyIDG Books Worldwide\%Julia KellyIDG Books WorldwideFroJulia Kelly Marilyn KydJulia Kelly Marilyn Kyd%Julia KellyIDG Books Worldwide\%Julia KellyIDG Books Worldwide\%Julia KellyIDG Books Worldwide&k %IDG Books Worldwide Marilyn Kyd %IDG Books Worldwide Marilyn Kyd %IDG Books Worldwide Julia Kellyf{ %IDG Books Worldwide Julia Kelly+ %IDG Books Worldwide Julia Kelly,%IDG Books Worldwide Julia Kelly4%IDG Books Worldwide Marilyn Kyd%IDG Books Worldwide Julia Kellyf{%IDG Books Worldwide Julia Kellyf{%IDG Books Worldwide Julia Kelly:%IDG Books Worldwide Julia Kelly;%IDG Books Worldwide Julia Kellyf{%IDG Books Worldwide Julia Kellyf{%IDG ls} ld!g׀dRgdRgdRgldRgd"ddk+ Add a para break before a
                                                                                                                            tagdgdgps j
                                                                                                                            s ls lrdRs ls ls lrdRs ls} ld!g׀dRgdRgdRgl dRgd"ddk# Move
                                                                                                                            tags to end of prev linedgdgps j^p
                                                                                                                            s ls lrdRs ls ls lrdRs ls} ld!g׀dRgj
                                                                                                                            dRgdRgps j
                                                                                                                            s lrdos ls lrdos ls lrdos ls} ld"ddddi SpecialFixis$ir$dk: This routine takes into account the special case when thedk9
                                                                                                                            or

                                                                                                                            is followed by a paragraph mark, rather thandk2 text. In that case, leave it -- its for spacing.dk; It expects the search string to end with a paragraph mark,dk; and inserts one after the replacement (can't insert "^p"!)dgdgps is$s ls lrdRs ls ls lrdRs ls} ld!g׀dRgj\seljtempdRgdRgg l dok0 Not at a paragraph mark. This is not a spacer.dok# Remove it, but preserve whitespacedogzjtempdogps j^wRk! Find whitespace in the selectiondog׀dogmok Save whitespacedogzjtempRk Replace original selection,dogir$ok removing the
                                                                                                                            or

                                                                                                                            tagdogdognok Reinsert whitespacedo dogir$dogdoTdRTdRgps is$s ls lrdos ls ls lrdos ls} ld"ddddi ProcessTextdRk Process Special CharactersdRdRk" TURN OFF SUBSTITUTIONS IN ITALICSdRk/ THAT MEANS HTML CAN BE EMBEDDED, IF ITALICIZEDdRgtdRgqs% ldRdRk ampersand-&dRi FixNonCodej&j&dRdRk dRi FixNonCodej>j>dRdRk quote-"dRi FixNonCodegl"j"dRdRk Non-breaking spacedRi FixNonCodej^sj dRdRk+ Process Bold, Italic, & Strikethrough TextdRiCleanParagraphMarksRk* Remove char formatting in paragraph marksdRgtdRgqs$ ldRiFixNonHeadingTextjj dRgtdRgqs% ldRiFixNonHeadingTextjjdRgtdRgqs ldRiFixNonHeadingTextjjddddiProcessGraphicsdRgdRk Search For graphicsdRgps j^gs ls lrdos ls ls lrdos ls} ldR!g׀dogdR"ddddiCleanParagraphMarksdRk1 Remove font characteristics from paragraph marksdRgtdRgydRgvs( ls# lrdos ls ls lrdos' ls] ls; lrdos$ ls% ldRgus j^ps j^psrdos ls lrdos ls ls lrdos ls} lddddiFixSectionBreaksdgdgps j^bs ls lrdRs ls ls lrdRs ls} ld!g׀dRgdRiAddLinej

                                                                                                                            ^pdRgd"ddddi FixNonCodeiold$inew$dk- Do the conversion, except in Code paragraphsdgdgps iold$s ls lrdRs ls ls lrdRs ls} ld!g׀dRis$ g"dRgis$l jCodedoginew$dRTdRgd"ddddiFixNonHeadingTextibeginIt$iendIt$dk9 Do the conversion, except in Heading or Title paragraphsdgdgps js ls lrdRs ls ls lrdRs ls} ld!g׀dRis$ g"dRngis$l jHeadingrdRgis$l jTitledogj \EndOfSeljEndPointdog.dogzj \StartOfSeldog.Rk' In case there is something ahead of usdogibeginIt$dogzjEndPointdogs jEndPoints dok% Necessary to fix Word bug. Where itdok" finds the bookmark as bold, next.dog.dogiendIt$dRTdRgd"ddddiProcessParagraphsdgdi laststartTag$ jdi lastEndTag$ jdi lastListLevel ld!g܁dRg" jHTML*iNextTagdRdRk Horizontal Rule ProcessingdRg$ ldoi AddIndenti listLeveldoiAddLinej
                                                                                                                            Rk Top Border => Horiz. RuledRTdRi Style2Tag$dRdRk* Special Title Processing (Title & Title2)dRni startTag$ i lastStartTag$rdRiendTag$ j

                                                                                                                            doiAddj
                                                                                                                            do*iNextTagdRTdRdRk Finish old tagdRi lastEndTag$ jdoi AddIndenti lastListLeveldoiAddLinei lastEndTag$dRTdRdRk List ProcessingdRi listEndTag$ jNoChgdok2 If not already in a list at this level, start onedok, This happens for "List Continue" paragraphsdoni listTagStack$i listLevel jdoi listStartTag$ j
                                                                                                                              doi listEndTag$ j
                                                                                                                            doi listTagStack$i listLevel i listEndTag$doTdRBooks Worldwide Julia Kellyf{%IDG Books Worldwide Marilyn Kyd%IDG Books Worldwide Julia KellyE%IDG Books Worldwide Julia Kellyf{%IDG Books Worldwide Julia Kellyf{%IDG Books Worldwide Julia Kellyf{%IDG Books Worldwide Julia Kellyf{%Julia KellyIDG Books Worldwide&k%Julia KellyIDG Books Worldwide&k%IDG Books Worldwide Julia KellyM %IDG Books Worldwide Julia KellyN!%IDG Books Worldwide Julia Kellyf{"%Julia KellyIDG Books Worldwide&kp#%IDG Books Worldwide Julia Kellyf{$%IDG Books Worldwide Julia Kellyf{%%IDG Books Worldwide Julia Kellyf{&%IDG Books Worldwide Julia Kellyf{'%IDG Books Worldwide Julia Kellyf{(%Julia KellyIDG Books Worldwide&k)%Julia KellyIDG Books Worldwide&kt*%IDG Books Worldwide Julia Kellyf{!+%IDG Books Worldwide Julia Kellyf{,%IDG Books Worldwide Julia Kellyf{-%IDG Books Worldwide Julia KellyS.%IDG Books Worldwide Julia KellyU/%IDG Books Worldwide Marilyn Kyd0%IDG Books Worldwide Julia Kellyf{"1%IDG Books Worldwide Julia Kellyf{$2%IDG Books Worldwide Julia Kellyf{3%IDG Books Worldwide Julia Kellyf|W4%IDG Books Worldwide Julia Kellyf|X5%IDG Books Worldwide Julia Kellyf|b6%IDG Books Worldwide Marilyn Kyd!7%IDG Books Worldwide Marilyn Kyd"8%IDG Books Worldwide Julia KellyY9%IDG Books Worldwide Julia Kellyf{&:%IDG Books Worldwide Julia Kelly!;%IDG Books Worldwide Julia Kelly#<%IDG Books Worldwide"!)dgdgps is$s ls lrdRs ls ls lrdRs ls} ld!g׀dRgj\seljtempdRgdRgg l dok0 Not at a paragraph mark. This is not a spacer.dok# Remove it, but preserve whitespacedogzjtempdogps j^wRk! Find whitespace in the selectiondog׀dogmok Save whitespacedogzjtempRk Replace original selection,dogir$ok removing the
                                                                                                                            or

                                                                                                                            tagdogdognok Reinsert whitespacedo dogir$dogdoTdRTdRgps is$s ls lrdos ls ls lrdos ls} ld"ddddi ProcessTextdRk Process Special CharactersdRdRk" TURN OFF SUBSTITUTIONS IN ITALICSdRk/ THAT MEANS HTML CAN BE EMBEDDED, IF ITALICIZEDdRgtdRgqs% ldRdRk ampersand-&dRi FixNonCodej&j&dRdRk dRi FixNonCodej>j>dRdRk quote-"dRi FixNonCodegl"j"dRdRk Non-breaking spacedRi FixNonCodej^sj dRdRk+ Process Bold, Italic, & Strikethrough TextdRiCleanParagraphMarksRk* Remove char formatting in paragraph marksdRgtdRgqs$ ldRiFixNonHeadingTextjjdRgtdRgqs% ldRiFixNonHeadingTextjjdRgtdRgqs ldRiFixNonHeadingTextjjddddiProcessGraphicsdRgdRk Search For graphicsdRgps j^gs ls lrdos ls ls lrdos ls} ldR!g׀dogdR"ddddiCleanParagraphMarksdRk1 Remove font characteristics from paragraph marksdRgtdRgydRgvs( ls# lrdos ls ls lrdos' ls] ls; lrdos$ ls% ldRgus j^ps j^psrdos ls lrdos ls ls lrdos ls} lddddiFixSectionBreaksdgdgps j^bs ls lrdRs ls ls lrdRs ls} ld!g׀dRgdRiAddLinej

                                                                                                                            ^pdRgd"ddddi FixNonCodeiold$inew$dk- Do the conversion, except in Code paragraphsdgdgps iold$s ls lrdRs ls ls lrdRs ls} ld!g׀dRis$ g"dRgis$l jCodedoginew$dRTdRgd"ddddiFixNonHeadingTextibeginIt$iendIt$dk9 Do the conversion, except in Heading or Title paragraphsdgdgps js ls lrdRs ls ls lrdRs ls} ld!g׀dRis$ g"dRngis$l jHeadingrdRgis$l jTitledogj \EndOfSeljEndPointdog.dogzj \StartOfSeldog.Rk' In case there is something ahead of usdogibeginIt$dogzjEndPointdogs jEndPoints dok% Necessary to fix Word bug. Where itdok" finds the bookmark as bold, next.dog.dogiendIt$dRTdRgd"ddddiProcessParagraphsdgstEndTag$ iendTag$dRi lastListLevel i listLeveldRni listLevellrdRi listEndTag$ jNoChgdoi listTagStack$i listLevel i listEndTag$dRTd"ddddi IndentCodedRgdRgtdRgss jCodedRgps js ls lrdos ls ls lrdos ls} ldR!g׀dogdogj dogzj\Paradogdogps js ls lrdos ls ls lrdos ls} ldR"ddddiConvertNewlinesdis$ j^piIndentSpacing$i listLevelj
                                                                                                                            dgzj\Paradgus j^lrdos is$srdos ls ls lrdos ls ls lrdos} lddddi Style2Tag$dis$ g"dgbiconversionWindow$dgdgdgps is$s ls lrdRs ls ls lrdRs ls} ldg׀dRi startTag$ iGetNextCellVal$dRiendTag$ iGetNextCellVal$dRi listLevel giGetNextCellVal$dRi listStartTag$ iGetNextCellVal$dRi listEndTag$ iGetNextCellVal$dRi breakTag$ iGetNextCellVal$d dRiresponse g+jUndefined style: is$rdonj. Using default tags. rdonj7To eliminate this message, put an entry in DOC2HTML.DOTrdnjDOC2HTMLldRiresponse lgGldRi startTag$ j

                                                                                                                            dRiendTag$ jdRkB Note: Leave current list level and list start/end tags unchanged.dTdeDonedgbi workWindow$ddddiGetNextCellVal$dgπdis$ gdis$ jnoneis$ jdiGetNextCellVal$ is$ddddiAddStartStructuredgdiAddLinejdiAddLinejdi ProcessHeaderdiAddLinejdiAddLinejRk Extra para breakdkAddLine("")diAddLinejddddiAddEndStructuredgdgRk (Don't use AddLine here)ddk Close any open listsd#ii l$l%ldRi listTagStack$ii jdoi AddIndentiidoiAddLinei listTagStack$iidoi listTagStack$ii jdRd&iiddiAddLinejdiAddLinejddddi ProcessHeaderdiSavePosdit$ i docTitle$dia$ i docAuthor$di RestorePosdit$ jiAddLinejit$jdk< Is the right tag? Its showing up in the document,dk' even though its defined in the header.dk8 If a$ <> "" Then AddLine("" + a$ + "")ddddiAdditag$dgitag$dgi specialTag$ddddiAddLineitag$dk Adds a tag line dk& Does not change existing para's styledgitag$dgdgdgi specialTag$dgddddi AddIndentileveldilevelldR#ii l$ileveldogiindent$dR&iidTddddiIndentSpacing$ileveldis$ jdilevelldR#ii l$ileveldois$ is$iindent$dR&iidTdiIndentSpacing$ is$ddddiGetStatsdgVs.RkUpdate doc statsd>istatsddddi docAuthor$dk! Returns name of current documentdk, WORD BUG: "stats.Author" = "undefined fielddk3 EVEN THOUGH: When saving, the syntax is recognizeddk- ("Author" is automatically init-capped)dis$ istatsskRk Workarounddis$ j*iDoneddk. Look for "byline" or "Byline" paragraph styledgdgejbyline jdRgss jbylinedRgps js ls lrdos ls ls lrdos ls} ldRg׀dogllRk Eliminate the paragraph markdois$ gdo*iDonedRTdTdgejByline jdRgss jBylinedRgps js ls lrdos ls ls lrdos ls} ldRg׀dogllRk Eliminate the paragraph markdois$ gdo*iDonedRTdTdeDonedi docAuthor$ is$ddddi docTitle$dRk! Returns name of current documentdRk Look for title paragraphs(s)dRgdRgss jTitledRgps js ls lrdos ls ls lrdos ls} ldRg׀dogllRk Eliminate the paragraph markdois$ gdRTdRidoit ldR!idoit ldok" Concatenate additional paragraphsdoglRk Go to next paradog" jTitlerdog" jTitle2dog dog ldogllRk Eliminate the paragraph markdois$ is$j gdoidoit ldo doidoit ldoTdR"dRgtdRi docTitle$ is$ddddidocName$dk! Returns name of current documentdis$ istatssgdidotIndex gis$j.didocName$ gis$idotIndexlddddidocDir$dk6 Returns the directory containing the current docudi laststartTag$ jdi lastEndTag$ jdi lastListLevel ld!g܁dRg" jHTML*iNextTagdRdRk Horizontal Rule ProcessingdRg$ ldoi AddIndenti listLeveldoiAddLinej


                                                                                                                            Rk Top Border => Horiz. RuledRTdRi Style2Tag$dRdRk* Special Title Processing (Title & Title2)dRni startTag$ i lastStartTag$rdRiendTag$ j
                                                                                                                          • doiAddj
                                                                                                                            do*iNextTagdRTdRdRk Finish old tagdRi lastEndTag$ jdoi AddIndenti lastListLeveldoiAddLinei lastEndTag$dRTdRdRk List ProcessingdRi listEndTag$ jNoChgdok2 If not already in a list at this level, start onedok, This happens for "List Continue" paragraphsdoni listTagStack$i listLevel jdoi listStartTag$ j
                                                                                                                              doi listEndTag$ j
                                                                                                                            doi listTagStack$i listLevel i listEndTag$doTdRTdRi listLeveli lastListLeveldok Start new listdoi AddIndenti listLeveldoiAddi listStartTag$dR k listLevel <= lastListLeveldok Close all deeper-level listsdo#ii i lastListLevel$i listLevell%ldoi AddIndentiidoi listTagStack$ii jdoi Julia Kellyo=%IDG Books Worldwide Marilyn Kyd>%IDG Books Worldwide Julia Kelly?%IDG Books Worldwide Julia Kelly@%IDG Books Worldwide Julia KellyA%IDG Books Worldwide Julia Kelly)B%IDG Books Worldwide Julia KellyOC%IDG Books Worldwide Julia KellyD%IDG Books Worldwide Julia KellyE%IDG Books Worldwide Julia KellyF%IDG Books Worldwide Julia KellyG%IDG Books Worldwide Marilyn Kyd#H%IDG Books Worldwide Julia KellyI%IDG Books Worldwide Julia KellyJ%IDG Books Worldwide Julia KellyK%IDG Books Worldwide Marilyn Kyd#L%IDG Books Worldwide Marilyn Kyd#M%IDG Books Worldwide Marilyn Kyd#N%IDG Books Worldwide Julia KellyO%IDG Books Worldwide Julia KellyP%IDG Books Worldwide Marilyn Kyd#Q%IDG Books Worldwide Julia Kelly0R%IDG Books Worldwide Julia KellyS%IDG Books Worldwide Julia KellyT%IDG Books Worldwide Julia KellyPU%IDG Books Worldwide Julia KellyF#&V%IDG dos ls ls lrdos ls} ldRg׀dogllRk Eliminate the paragraph markdois$ gdo*iDonedRTdTdgejByline jdRgss jBylinedRgps js ls lrdos ls ls lrdos ls} ldRg׀dogllRk Eliminate the paragraph markdois$ gdo*iDonedRTdTdeDonedi docAuthor$ is$ddddi docTitle$dRk! Returns name of current documentdRk Look for title paragraphs(s)dRgdRgss jTitledRgps js ls lrdos ls ls lBooks Worldwide Julia Kelly:dW%IDG Books Worldwide Julia Kelly:pX%IDG Books Worldwide Marilyn KydZY%Julia KellyIDG Books WorldwidenZ%IDG Books Worldwide Julia Kelly4\[%IDG Books Worldwide Julia Kelly3\ Da John Read] John Osborn^ Jerry Condon_Raymond Novello` IDG Editoriala%ACku|! HT*/^c(,{D Srdos ls} ldRg׀dogllRk Eliminate the paragraph markdois$ gdRTdRidoit ldR!idoit ldok" Concatenate additional paragraphsdoglRk Go to next paradog" jTitlerdog" jTitle2dog dog ldogllRk Eliminate the paragraph markdois$ is$j gdoidoit ldo doidoit ldoTdR"dRgtdRi docTitle$ is$ddddidocName$dk! Returns name of current documentdis$ istatssgdidotIndex gis$j.didocName$ gis$idotIndexlddddidocDir$dk6 Returns the directory containing the current documentdidocDir$ istatsshddddiSavePosdk7 Saves the current position for later use by RestorePosdgjsaveLocsddddi RestorePosdk, Returns to the position saved with SavePos.dgzjsaveLocdgjsaveLocs ddddiEraseHeaderFooterInfodgdg lgNk Go to Header areadgn lgQRk Go to Header areadgdgdgNRk Go to Footer areadgdgdgddddi TemplatePath$ditPath$ jdisize gld#ii l$isizedRitp$ gyiildRgitp$j DOC2HTML.DOT ldoitPath$ itp$do*iDonedRTd&dk4 MsgBox msg$, "Current Global Templates and Add-Ins"ditPath$ jdRg+j4DOC2HTML.DOT needs to be added as a global template.rdoj gl rdoj"Choose File:Templates, click Add, rdojand browse for the template.rdogl rdojThen click OK.dRgGldTeDonedi TemplatePath$ itPath$d dk DOC2HTML:dk# Creates a file called "XXXX.htm".dk; Where "XXXX" is the name of the currently active document.dk USAGE NOTESdk< * Things are easier to see if you open up this template anddk$ reduce it to a very small windowdk * To close the .HTM file:dk! 1. From File menu, choose CLOSEdk 2. Choose "Save changes YES" dk( 3. Choose "Text Only with Line Breaks"dk* 4. Unless particular spacing is desired,dk. a lot of documents should convert cleanlydk in a single pass.dk FEATURES:dk/ * Creates basic HTML structure (header & body)dk) * Creates HTML header information using:dk5 * Document properties Title & Author, if they existdk3 * Or using Title/Byline paragraphs, if they existdk; * Uses paragraph styles to create logical HTML format tagsdk@ * Table-driven conversion using editable table in this templatedk: * If paragraph has BorderTop() true, its preceded by
                                                                                                                            dk2 * Handles nested lists. Indents to show nesting.dk * Convert NL's to breaksdk1 * Convert non-heading bold & italic text styles dk (to logical format tags)dk. * Convert strikethrough text to formatdk; * Converts first tab or NL in a start-definition paragraphdk: to
                                                                                                                            ...
                                                                                                                            . (controlled by the value of "Break Tag"dk in the table.dk TODO:dk4 * Find out what the right header tag is for author.dkE One authoring tool used "", but Netscape is displaying it.dk7 * Convert contained bmp files to Gif files and includedk * Convert tablesdk8 * Convert help file bitmap references to gif referencesdk$ and convert bmp files to Gif filesdk* * Convert help file links to HTML anchorsdkB * Read "addSpaceLimit" and text-substitution values from templatedk' (at the moment, they are hard-coded)dk RESTRICTIONS:dk< * A bug in Word prevents reading the Property sheet for thedkB Author value. For some reason, the reference to "stats.Author"dkA fails, even though the to reference to "stats.Title" succeeds.dkB (stats is the DocumentStatistics record). Workaround is to usedk4 the .LastSavedBy value, which is usually correct.dd/0istats4gNd/0i workWindow$d/0iconversionTableFile$d/0iconversionWindow$d/0i specialTag$d/0i startTag$d/0iendTag$d/0i listLeveld/0i listStartTag$d/0i listEndTag$d/0i listTagStack$ld/0i breakTag$d/0iindent$Rk Indent for nested listsd/0i addSpaceLimitdRk8 If paragraph's space-before value is greater than this,dRk9 Then add and extra line for spacing. (Using 5, for now)ddiInitdk Setup output filedicurrDir$ idocDir$dicurrDir$ jdRg+j&Current document has not been saved. gl rdonj/Please save it and make sure that DOC2HTML.DOT rdonjis in the same directory.dRgGldTdifn$ idocName$di firstWindow$ g;dgD lgDlRk go to Window statedidWidth gdidHeight gdidLeft gFdidTop gEddk Open conversion tablediconversionTableFile$ i templatePath$dgPs iconversionTableFile$sU ldRk* .ReadOnly = 1 was a nice idea, but becamedRk5 a nuisance -- cannot easily edit the table and retrydiconversionWindow$ g;dgl lHdglHRk 72 points, 1 inchdg2idLeftl idTopidHeightl k Underneath work windowddk Save HTM versiondgbi firstWindow$di pathname$ icurrDir$j\ifn$j.htmdgTs i pathname$s ldg2idLeftl idTopldi workWindow$ g;ddk Re-open the original filedgPs icurrDir$j\ifn$j.docdg3idWidthidHeightdg2idLeftidTopdgbi workWindow$ddk' Set up a style tag for processed linesdiindent$ j Rk 4 space indent for nested listsdi addSpaceLimit ldi specialTag$ jHTMLdgs i specialTag$s{ jNormals,dgs ls lrdRs lsD ldgs( ls# ls' lrdRs ls ls lrdRs] ls; ls$ ls% lddddiMAINdiGetStatsdiInitddi ProcessTextRk/ Before adding structure, to handle "<" and ">"di IndentCodediFixSectionBreaksdiAddStartStructurediProcessParagraphsdiProcessGraphicsdiAddEndStructurediCleanUpSpacingdiEraseHeaderFooterInfoddk) Leave the newly converted file open opendk- Leave conversion table open for adjustments.dk Activate conversionWindow$dk FileClose 2ddddiCleanUpSpacingdk PRETTY PRINTINGdk; List Continue styles (endList tag="NoChg") have
                                                                                                                              addeddk< when they are not already part of a list. This   ( * B E ? D .03@PVEric ArmstrongC:\APPS\WRD-BIN\DOC2HTML.DOTEric ArmstrongC:\APPS\WRD-BIN\DOC2HTML.DOTEric ArmstrongC:\APPS\WRD-BIN\DOC2HTML.DOTEric ArmstrongC:\APPS\WRD-BIN\DOC2HTML.DOTEric ArmstrongC:\APPS\WRD-BIN\DOC2HTML.DOTEric ArmstrongC:\APPS\WRD-BIN\DOC2HTML.DOTEric ArmstrongC:\APPS\WRD-BIN\DOC2HTML.DOTEric ArmstrongC:\APPS\WRD-BIN\DOC2HTML.DOTEric ArmstrongC:\APPS\WRD-BIN\DOC2HTML.DOTEric ArmstrongC:\APPS\WRD-BIN\DOC2HTML.DOTNlastDateLevel130JlastDateLevel14$4JlastDateLevel15mD matchedText F 04-May-95 03-may-95 03-may-95 wed 03-may-95Up@{doc2htmlkConverts a word document to an HTML text file. A table gvies para. style => logical format tag conversions.pDOC2HTML@HP LaserJet 6P/6MP - EnhancedLPT1:HPBXLAHP LaserJet 6P/6MP - EnhancedHP LaserJet 6P/6MP - EnhancedD).X)HP LaserJet 6P/6MP - EnhancedD).X)  ~ + , }  /0()@AWAAA@ @/@o A*A-A6A7AFAXAYAA@o AAA@AASAnAT@@AA@@@CTimes New Roman Symbol &Arial5Courier New"Ah :1~_ $R"DOCument To HTML Conversion FilterEric ArmstrongEric Armstrong