home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a108 / 6.ddi / SAMPLES / SPLUS / SP_SAVE.PRG < prev    next >
Encoding:
Text File  |  1993-09-09  |  2.2 KB  |  92 lines

  1. * Test code for Schedule+ save appointment and meeting functions.
  2.  
  3. * load the FLL.
  4.  
  5. SET LIBRARY TO foxmapi.fll
  6.  
  7. * start MAPI and SPLUS sessions.
  8.  
  9. hmapisession = 0
  10. hsplussession = 0
  11. retval=mplogon(0, "", "", 3, 0, @hmapisession)
  12. retval=spbegin(hmapisession, 0, 0, 0, @hsplussession)
  13.  
  14. * create cursors for appointments, attendance, and messages.
  15.  
  16. =mpcursor("SPlusAppt", "")
  17. =mpcursor("SPlusAttd", "")
  18. =mpcursor("SPlusMesg", "")
  19.  
  20. * Set initial values.  Refer to Schedule+ help file for details
  21. * of these fields.
  22.  
  23. SELECT splusappt
  24. SET SAFETY OFF
  25. ZAP
  26. SET SAFETY ON
  27. APPEND BLANK
  28.  
  29. REPLACE reserved WITH 0
  30. REPLACE itemtype WITH "OrganizedMeeting"
  31. REPLACE flags WITH 0
  32. REPLACE assoccount WITH 0
  33. REPLACE orgitemid WITH ""
  34. REPLACE attendcnt WITH 1
  35. REPLACE recurrence WITH ""
  36. REPLACE datestart WITH "1993/08/16 12:30"
  37. REPLACE dateend WITH "1993/08/16 13:30"
  38. REPLACE TEXT WITH "Hello from Foxprow"
  39.  
  40. * Fill in MapiAttd with fields for user Chriscap.
  41.  
  42. retval=mpresolve(0, 0, "Chriscap", 9, 0, "MapiAttd")
  43. WAIT WINDOW "The MPResolveName  code is " + STR(retval)
  44.  
  45. SELECT mapiattd
  46. GOTO TOP
  47. REPLACE reserved WITH 0
  48. REPLACE recipclass WITH 1
  49.  
  50. SELECT splusattd
  51. SET SAFETY OFF
  52. ZAP
  53. SET SAFETY ON
  54. APPEND BLANK
  55. REPLACE reserved WITH 0
  56. REPLACE usertype WITH "Individual"
  57. REPLACE STATUS WITH 1
  58.  
  59. * Create new appointment.
  60.  
  61. lpszitemid = ""
  62.  
  63. retval = spsaveappt(hsplussession, 0, "", "SPlusAppt", "", "SPlusAttd", "MapiAttd", 0, 0, @lpszitemid)
  64. WAIT WINDOW "return from SPSaveAppt = " + STR(retval) + " ItemID = " + lpszitemid
  65.  
  66. SELECT splusmesg
  67. APPEND BLANK
  68.  
  69. REPLACE reserved WITH 0
  70. REPLACE subject WITH splusappt.text
  71. REPLACE notetext WITH ""
  72. REPLACE messagtype WITH "IPM.Microsoft Schedule.MtgReq"
  73. REPLACE daterecved WITH "1993/06/15 10:30"
  74. REPLACE convertnid WITH ""
  75. REPLACE flags WITH 65536
  76. REPLACE recipcount WITH splusappt.attendcnt
  77. REPLACE filecount WITH 0
  78. REPLACE sentforcnt WITH 0
  79.  
  80. * Create new meeting.
  81.  
  82. retval = spsendmeet(0, 0, "SPlusMesg", "MapiAttd", "", "", "SPlusAppt", "", "SPlusAttd", "MapiAttd", 0, 0)
  83. WAIT WINDOW "return from SPSendMeet = " + STR(retval)
  84.  
  85. * Logoff from SPLUS and MAPI.
  86.  
  87. retval=spend(hsplussession, 0, 0, 0)
  88. retval=mplogoff(hmapisession, 0, 0, 0)
  89.  
  90. SET LIBRARY TO
  91.  
  92.