Information générale
Catégorie:
Fonctions Windows API
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement