home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgLangD.iso / Bonus / WSTAR2 / DISK4 / UPDSTYLS.WM_ / UPDSTYLS.bin
Encoding:
Text File  |  1994-02-28  |  12.3 KB  |  118 lines

  1. REM Description:  Updates paragraph and frame styles from default template.
  2. REM Filename: updstyls.wmc
  3. REM Created by:  Steve Wylie - 12/08/93
  4.  
  5. DECLARE FUNCTION GetPrivateProfileString LIB "kernel" (lpApplicationName AS STRING, lpKeyName AS STRING, lpDefault AS STRING, lpReturnedString AS STRING, nSize As WORD, lpFileName AS STRING) As Integer 
  6.  
  7. CONST iniFile$ = "wsw.ini"
  8.  
  9. REM Can't run if no document open
  10. IF GetDocName$() = "" THEN
  11.     MESSAGE "Please create a new document or open an existing document first."
  12.     STOP
  13. ENDIF
  14.  
  15. cr$ = CHR$(13)
  16. msgText$ = "This command will import the paragraph and frame styles from your "
  17. msgText$ = msgText$ + "default template." + cr$ + "Any styles in this document with the "
  18. msgText$ = msgText$ + "same names as the styles in your default template will "
  19. msgText$ = msgText$ + "be overwritten." + cr$ + cr$ + "Are you sure you want to do this?"
  20.  
  21. ret% = MESSAGEBOX(msgText$, "Update Styles from Default Template", 4+32)
  22.  
  23. IF ret% = 7 THEN STOP
  24.  
  25. ' Get the default template directory.
  26. ret% = W2I(GetPrivateProfileString("Preferences", "TemplateDirectory", "", dir$, I2W(255), iniFile$))
  27.  
  28. IF ret% <> 0 THEN
  29.     IF RIGHT$(dir$, 1) <> "\" THEN dir$ = dir$ + "\"
  30. ENDIF
  31.  
  32. ' Get the name of the default template.
  33. ret% = W2I(GetPrivateProfileString("Preferences", "Template", "default.wst", filename$, I2W(255), iniFile$))
  34.  
  35. fileName$ = dir$ + fileName$
  36.  
  37. ' Make sure the file exists before trying to open it:
  38. IF Access(fileName$, 0) <> 1 THEN
  39.     cr$ = CHR$(13) + CHR$(13)
  40.     msg$ = "This file does not exist." + cr$ + "Make sure your default template directory in Preferences is correct, or reinstall WSWin."
  41.     ret% = MESSAGEBOX(fileName$ + cr$ + msg$, "Template Error", 0 + 16)
  42. ENDIF
  43.  
  44. ' Switch to edit mode to import paragraph styles
  45. orig% = ViewEditMode(1)
  46.  
  47. FileImport filename$, "WSWin Paragraph Styles", 0, 4+16
  48.  
  49. ' Switch to frame mode to import frame styles
  50. ret% = ViewEditMode(2)
  51.  
  52. FileImport filename$, "WSWin Frame Styles", 0, 4+16
  53.  
  54. ' Switch back to the original mode.
  55. ret% = ViewEditMode(orig%)
  56.  
  57. 
  58. *****  WARNING *****
  59. This is a WSWin macro file.
  60. Subsequent data is binary information and should not be modified.
  61. # MF # 1.0None762570836║Ω:!î&
  62. 8    ìÄ
  63. 8
  64. ÅÆô
  65. âÆæöâ
  66. 8
  67.  ùû
  68. òùÿÖ
  69. 8 
  70. 8¥£
  71. ¢¥₧ƒ    Ü₧
  72. 8    áí
  73. 8"ñáó"ÑñÜ"ªÑú    áª
  74. 8"¿áº    á¿
  75. 8"½á⌐"¼½Ü"¡¼Ü"«¡¬    á«
  76. 8┤▒╡▓│░á┤╡»╢
  77. 8
  78. â»╕╣â
  79. 8
  80. 8└╗┴╝┬æ├┐
  81. ╛├─┼à└┴┬╜─ì╞
  82. ║╞»╟
  83. 8 â»╔â
  84. 8!═Ç ╩╜═╬╧ â╬╠╨â
  85. 8!"╤╜╠    ╜╤
  86. 8"╒╗╓╥╫╙╪┐
  87. ╛╪┘┌à╒╓╫╘┘ì█
  88. ║█»▄
  89. 8"$"▌╜╘    ╘▌
  90. 8$&!α ▐╘αßΓ âßÇπâ
  91. 8&!(Σ£
  92. ¢Σσµτ£
  93. ¢τΦΘ"ΩσΦ    ÜΩ
  94. 8()"ε∞Ü"∩εφ    δ∩
  95. 8)*"≥╘Ü"≤≥δ⌠≡⌡±░≤⌠⌡»÷
  96. 8*.∙Ç
  97. °∙≈·
  98. 8.0²ⁿ■ ▓±√╘²■ 
  99. 803
  100. °»
  101. 835▓±√╘
  102. 858
  103. °≈»     ~Rl                    .r.r.r .r-.r5.r;.rA.rN.r^.r    l.r
  104. z.r ê.r û.rñ.r▓.r╢.r╣.r╜.r└.r┬.r─.r╞.r╔.r╠.r╧.r╥.r╘.r╓.r┌.r▄.r▐.rα.r Γ.r!Σ.r"Θ.r#∞.r$≡.r%⌡.r&ⁿ.r'/r(
  105. /r)/r*/r+/r,"/r-(/r.-/r/3/r06/r1;/r2@/r3B/r4E/r5J/r6N/r7T/r8Y/r9`/r:g/r;l/r<o/r=w/r>y/r?{/r@/rAê/rBî/rCÅ/rDù/rE₧/rFú/rG¡/rH┤/rI╣/rJ╜/rK┬/rL╟/rM═/rN╤/rO╒/rP▄/rQπ/rRΩ/rS≡/rT≈/rU0rV0rW0rX$0rY10rZ:0r[G0r\P0r]X0r^`0r_h0r`q0rav0rb{0rcÇ0rdç0reÄ0rfö0rg¢0rh¥0rió0rj¿0rk«0rl╡0rm╛0rn╟0ro╦0rp╙0rq╫0rr▄0rsΓ0rtΦ0ruε0rv⌠0rw∙0rx■0ry1rz1r{1r|1r}r  r+r+    rrr  r rçBå8rArSr]rgrxr~rër
  106.           Ær+      £r
  107. ë¿r  X¡r+      ░r      ╡r     ║r  X┐rç╟r+      
  108. r      r  r     r
  109.           r
  110. ë "r+  %r  *r      /r     4r
  111.           =r+      ér+      ûr+      ╛r      ─r      ╩r      ╨r+      
  112. r      r+      "r+      Fr      Lr      Rr      Xr      ^r          crç"nr+      ör+  ûr+   Ör      ƒr  Ñr     ½r  B░r+  ▓r  B╖rç╗r+      ╔r+      ▌r
  113.           Γràµr+   Ωr      ≡r      ÷r      ⁿr  r  r     r  r     r  Σr  Σ$r
  114. ë+r  Σ0r+      4r  :r      @r     Fr  ΣKr      Qr+      \r+      jr
  115.           tr      zr      Çr      år  îr  Ær     ÿr  ₧r     ñr      ¬rç▒r  ⁿ╢r  ╝r  ┬r     ╚r  ⁿ╬r  ╘r      ┌r     αr  µr      ∞r     ≥r      °r
  116.           ²r+      r+      tr      zr      Çr+      ær+  ör      Ür      ár      ªr  ¼r     ▓r          ╕rç4┼r  ╦r     ╤rA/▄r+      ⌡r      √r  r  r     r+  r  r     r+      0r      6r  <r  Br     Hr     NrPr????01CANCELERRORNUM[T1]
  117. GETPRIVATEPROFILESTRING"kernel"LPAPPLICATIONNAMELPKEYNAMELPDEFAULTLPRETURNEDSTRINGNSIZELPFILENAMEINIFILE$"wsw.ini"GETDOCNAME$[L1]""[T2][T3][L2]MESSAGE"Please create a new document or open an existing document first."[T4][T5][T6]CR$CHR$13[T7][T8][T9]MSGTEXT$"This command will import the paragraph and frame styles from your ""default template.""Any styles in this document with the "[T10][T11][T12]"same names as the styles in your default template will "[T13]"be overwritten.""Are you sure you want to do this?"[T14][T15][T16][T17]RET%MESSAGEBOX"Update Styles from Default Template"432[T18][T19][T20][L3]7[L4]W2I"Preferences""TemplateDirectory"DIR$I2W255[T21][T22][T23][T24][T25][T26][T27][T28][L5][L6]RIGHT$[L7]"\"[T29][T30][T31][L8][T32]"Template""default.wst"FILENAME$[T33][T34][T35][T36][T37][T38][T39][T40][T41]ACCESS[L9][T42][T43][T44][L10][T45][T46][T47][T48][T49][T50][T51]MSG$"This file does not exist.""Make sure your default template directory in Preferences is correct, or reinstall WSWin."[T52][T53]"Template Error"16[T54][T55][T56][T57][T58]ORIG%VIEWEDITMODE[T59][T60]FILEIMPORT"WSWin Paragraph Styles"[T61][T62][T63][T64]2[T65][T66]"WSWin Frame Styles"[T67][T68][T69][T70][T71]
  118.