home *** CD-ROM | disk | FTP | other *** search
/ Windows Shareware GOLD / NuclearComputingVol3No1.cdr / other / f1238 / psenv.mac < prev    next >
Text File  |  1990-12-25  |  2KB  |  73 lines

  1. Sub MAIN
  2. DisableInput 0
  3. CrLf$ = Chr$(13) + Chr$(10)
  4. Name1$ = "Sender 1"
  5. Name2$ = "Sender 2"
  6. Name3$ = "Sender 1 and Sender 2"
  7. Address1$ = "Your Address Goes Here"
  8. Address2$ = "Your City, State Goes Here"
  9. Begin Dialog UserDialog 370, 144
  10.      GroupBox 8, 6, 250, 125, "Choose Name of Sender"
  11.      OptionGroup .Sender
  12.      OptionButton 16, 30, 250, 18, Name1$
  13.      OptionButton 16, 50, 250, 18, Name2$
  14.      OptionButton 16, 70, 250, 18, Name3$
  15.      OptionButton 16, 90, 250, 18, "None"
  16.      OKButton 280, 35, 68, 21
  17.      CancelButton 280, 62, 68, 21
  18. End Dialog
  19. Dim dlg As UserDialog
  20. On Error Goto Bye
  21. Dialog dlg
  22. On Error Goto Bye
  23. Select Case dlg.Sender
  24.      Case 0
  25.      Name$ = Name1$
  26.      Case 1
  27.      Name$ = Name2$
  28.      Case 2
  29.      Name$ = Name3$
  30.      Case 3
  31.      Name$ = " "
  32. End Select
  33. If ExistingBookmark("NameAddress") Then EditGoTo "NameAddress"
  34. If SelType() = 2 Then
  35.      VFC = ViewFieldCodes()
  36.      If VFC = - 1 Then ViewFieldCodes 0
  37.      Address$ = Selection$()
  38.      ViewFieldCodes VFC
  39.      Else
  40.      Address$ = InputBox$("Address:", "PostScript Envelope Printer")
  41. End If
  42. Open "lpt1" For Output As #1
  43. Print #1, "statusdict begin /manualfeed true store end"
  44. Print #1, "/F {findfont exch scalefont setfont} bind def"
  45. Print #1, "/S {show currentpoint exch pop 0 exch 12 sub moveto} bind def"
  46. Print #1, "0 792 translate" + CrLf$ + "-90 rotate"
  47. Print #1, "24 432 translate" + CrLf$ + "0 0 moveto"
  48. Print #1, "12 /Times-Roman F"
  49. If Name$ <> " " Then
  50.      Print #1, "(" + Name$ + ") S"
  51.      Print #1, "(" + Address1$ + ") S"
  52.      Print #1, "(" + Address2$ + ") S"
  53. End If
  54. Print #1, "272 -144 translate" + CrLf$ + "0 0 moveto"
  55. j = 1
  56. For i = 1 To Len(Address$)
  57.      Select Case Asc(Mid$(Address$, i))
  58.      Case 13, 11
  59.           Print #1, "(" + Mid$(Address$, j, i - j) + " ) S"
  60.           j = i + 1
  61.      Case 10
  62.           j = i + 1
  63.      Case Else
  64.      End Select
  65. Next i
  66. If j < Len(Address$) Then Print #1, "(" + Mid$(Address$, j) + " ) S"
  67. Print #1, "showpage" + CrLf$ + "statusdict begin /manualfeed false store end"
  68. Print #1, Chr$(4) ;
  69. Close
  70. Bye:
  71. End Sub
  72.  
  73.