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

  1. REM Description: Send current document as email attachment
  2. REM Filename: mailmapi.wmc
  3. REM Created by: Rich Zuris - 11/24/93
  4. REM This macro supports the MAPI email standard (Microsoft) only
  5.  
  6. 'Windows APIs
  7. DECLARE FUNCTION GetTempFileName LIB "kernel" (bDriveLetter AS WORD, lpszPrefixString AS STRING, uUnique AS WORD, lpszTempFileName AS STRING) As Word
  8. DECLARE FUNCTION MAPISendDocuments LIB "mapi.dll" (hwnd AS INTEGER, lpDelim AS STRING, lpPaths AS STRING, lpNames AS STRING, res AS INTEGER) AS Integer
  9.  
  10. 'Can't run if no document open
  11. IF GetDocName$() = "" THEN
  12.     MESSAGE "Please create a new document or open an existing document first."
  13.     STOP
  14. ENDIF
  15.  
  16. 'Get temporary file name and save copy of document
  17. 'Hope there's enough disk space on temp drive, etc.
  18. lpFileName$ = String$(144, " ")
  19. ret% = GetTempFileName(I2W(0), "WSW", I2W(0), lpFileName$)
  20. FileSaveAsCopy (lpFileName$)
  21.  
  22. 'Get title of this document from WSWin
  23. docName$ = GetDocName$()
  24. WHILE INSTR(docName$, "\")
  25.     docName$ = MID$(docName$, INSTR(docName$, "\") + 1)
  26. WEND
  27.  
  28. 'If doc is untitled, name it Untitled (sans number)
  29. IF LEFT$(docName$, 8) = "Untitled" THEN
  30.     docName$ = "Untitled.wsd"
  31. END IF
  32.  
  33. 'Call MAPI UI to send the document
  34. ret% = MAPISendDocuments(0, ";", lpFileName$, docName$, 0)
  35.  
  36. 'Delete the temp file
  37. KILL lpFileName$
  38. STOP
  39.  
  40. 
  41. *****  WARNING *****
  42. This is a WSWin macro file.
  43. Subsequent data is binary information and should not be modified.
  44. # MF # 1.0None762570524╬■2u
  45. 8 Æòû
  46. âòöùâ
  47. 8 ÜÖ
  48. ÿÜ¢£
  49. 8
  50. 8íƒóá ₧íóúñ    ¥ú
  51. 8¿
  52. ª¿⌐¬½º¼
  53. ª¼¡«à⌐½¡¥»Ñ»
  54. 8    ▒¥░▒▓
  55. 8Æ┤╡    │┤
  56. 8
  57. .âÇ│╖╕â
  58. 8
  59. .║Ç│╖╗║Ç
  60. -╣│╗    │╣╢
  61. 8'└╛ ╝│└┴┬
  62. â┴┐├â
  63. 8'    │─
  64. 8#╞╟┼╚ï╞╟¥│╚Ñ
  65. 8#&'¥
  66. 8&'╦~C6╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩.╧b.╧b.╧b .╧b-.╧b5.╧b;.╧bA.╧bN.╧b^.╧b    l.╧b
  67. z.╧b ê.╧b û.╧bñ.╧b▓.╧b╢.╧b╣.╧b╜.╧b└.╧b┬.╧b─.╧b╞.╧b╔.╧b╠.╧b╧.╧b╥.╧b╘.╧b╓.╧b┌.╧b▄.╧b▐.╧bα.╧b Γ.╧b!Σ.╧b"Θ.╧b#∞.╧b$≡.╧b%⌡.╧b&ⁿ.╧b'/╧b(
  68. /╧b)/╧b*/╧b+/╧b,"/╧b-(/╧b.-/╧b/3/╧b06/╧b1;/╧b2@/╧b3B/╧b4E/╧b5J/╧b6N/╧b7T/╧b8Y/╧b9`/╧b:g/╧b;l/╧b<o/╧b=w/╧b>y/╧b?{/╧b@/╧bAê/╧bBî/╧bCÅ/╧bDù/╧bE₧/╧bFú/╧bG¡/╧bH┤/╧bI╣/╧bJ╜/╧bK┬/╧bL╟/╧bM═/╧bN╤/╧bO╒/╧bP▄/╧bQπ/╧bRΩ/╧bS≡/╧bT≈/╧bU0╧bV0╧bW0╧bX$0╧bY10╧bZ:0╧b[G0╧b\P0╧b]X0╧b^`0╧b_h0╧b`q0╧bav0╧bb{0╧bcÇ0╧bdç0╧beÄ0╧bfö0╧bg¢0╧bh¥0╧bió0╧bj¿0╧bk«0╧bl╡0╧bm╛0╧bn╟0╧bo╦0╧bp╙0╧bq╫0╧br▄0╧bsΓ0╧btΦ0╧buε0╧bv⌠0╧bw∙0╧bx■0╧by1╧bz1╧b{1╧b|1╧b}'b  'b+'b+    'b'b'b  'b 'bàBå0'b9'bF'bW'b_'bp'bçBîé'bì'bÆ'bÜ'bó'b¬'b«'b
  69. ë║'b  H┐'b+      ┬'b      ╟'b     ╠'b  H╤'bç ┘'b+      'b      !'b  &'b     +'b
  70.           7'b
  71. ë?'b+  ÉC'b+      G'b  L'b      Q'b      V'b     \'b          a'bàe'b+      k'b  q'b  w'b     }'b      â'b  ë'b  Å'b     ò'b  ¢'bA¬'b      ░'b     ╢'b
  72.           ┐'b      ┼'b     ╦'b  Σ╨'b+      ╘'b  .┘'b      ▀'b  σ'b  δ'b
  73. ë±'b  h÷'b+  °'b+      'b      'b      'b     'b  h'b+      )'b+      -'b  3'b      9'b  ?'bA'b????01CANCELERRORNUM[T1]
  74. GETTEMPFILENAME"kernel"BDRIVELETTERLPSZPREFIXSTRINGUUNIQUELPSZTEMPFILENAMEMAPISENDDOCUMENTS"mapi.dll"HWNDLPDELIMLPPATHSLPNAMESRESGETDOCNAME$[L1]""[T2][T3][L2]MESSAGE"Please create a new document or open an existing document first."[T4][T5][T6]LPFILENAME$STRING$144" "[T7][T8][T9][T10]RET%I2W"WSW"[T11][T12][T13][T14][T15][T16][T17][T18]FILESAVEASCOPY[T19][T20]DOCNAME$[T21][T22][L3]"\"[L4][T23][T24][T25]LEFT$[L5]8"Untitled"[T26][T27][T28][L6]"Untitled.wsd"";"[T29][T30][T31]
  75.