Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
PRIVATE GWFolder As Folders
Message
De
10/12/1998 11:30:55
Sergio Ortiz
Tek Services Group, Llc
Hollywood, Floride, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00154329
Message ID:
00166118
Vues:
21
Hello Sandy,

I used the Groupwise 5.x Adimistrative Object API to upload and send messages from my VFP50 application to Groupwise.


Here is a routine to upload messages from groupwise HELP DESK account to a table called 'Log'. After uploading the messages I sent back a confirmation to the originator.



LOCAL lcFromText,;
lcBodyText,;
lcSubject,;
lcRequestID,;
lcBodyTextSend

*- I can only use this routine if I am logged as HELPDESK in Novell.
IF ('HELPDESK' $ UPPER(SYS(0)))
IF !USED('Log')
USE IN 0 DATA\Log
ENDIF
SELECT Log
SET DELETED ON

* Construct message
lcOleStatus = SET('oleobject')
SET oleobject ON
oGroupWise = CREATEOBJECT("NovellGroupWareSession")
SET oleobject &lcOleStatus
oAccount = oGroupWise.Login

oMailBox = oAccount.Mailbox
oMail = oMailBox.messages

nCountMailBox = 0
nCountAppendedRecords = 0

FOR EACH objMail IN oMail
*- Read all the messages that have not been opened from the MAILBOX
IF !(objMail.Opened)
*- Gather all the information and save it in the Local variables
lcFromtext = objMail.FromText
lcSubject = objMail.Subject.PlainText
lcBodyText = objMail.BodyText.PlainText

APPEND BLANK
REPLACE end_user WITH (lcFromText)
REPLACE to WITH 'HELP DESK'
REPLACE subject WITH (lcsubject)
REPLACE message with (lcBodyText)

REPLACE employee_id WITH '116'

lcRequestID = log_id
objMail.Opened = .T.
nCountMailBox = nCountMailBox + 1

*-- Send the reques back to the sender.
oFolder = oAccount.RootFolder
oMessages = oFolder.Messages
oDraftMsg = oMessages.Add
oRecips = oDraftMsg.Recipients
oRecip = oRecips.Add( lcFromText, 'NGW','0')
=oRecip.Resolve()
lcBodyTextSend = 'Your request has been received by the I.S. help desk. Your Reference'+;
'# is '+lcRequestID+' Please make note of this for tracking Purposes.'+;
'You will need this reference # when contacting MIS for any updates'

oDraftMsg.Subject = 'RE:'+lcSubject+'('+'Request #:'+lcRequestID+')'
oDraftMsg.BodyText = (lcBodyTextSend)

oSend = oDraftMsg.Send

ELSE
ENDIF
NEXT
WAIT WINDOW '# of messages are '+STR(nCountMailBox)
DoEvents
release oGroupWise
set oleobject &lcOleStatus
ELSE
* WAIT WINDOW 'NEED TO BE LOGGED AS HELPDESK'
=MESSAGEBOX('NEED TO BE LOGGED AS HELPDESK')
ENDIF
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform