PDA

View Full Version : Preview Groupwise Draft Messages before sending



rajpov
12-09-2009, 11:13 AM
Hello,
We use Groupwise as our e-mail application (V 7.03)
Our business needs require an e-mail to be created with specific emails addresses, Subject, Body and Attachments and then staged in the "Work In Progress" folder within groupwise. Then these e-mails are reviewed to make sure that the attachments (Sensitive information) are appropriate for the addressees. once this verification is completed then the e-mails are sent.

I am able to get everything mentioned above to work except to have the names of the recipients show up in the draft e-mails contained within the Work In Progress folder.

The Code below is an extract of what i am have with the relevant parts included. The only pieces missing are the attachments.


The funny thing is that if as the last step i choose to have the e-mail sent (.Send) it will send it to the addressees, but i just am not able to see the e-mails in the draft message.

I would greatly appreciate if someone can help me here. The VBA is running in Excel 2007.

Sub CreateMailPullingAttachmentsfromafolder ()
CreateMailPullingAttachmentsfromafolder Macro
'
Dim ogwApp As GroupwareTypeLibrary.Application
Dim ogwRootAcct As GroupwareTypeLibrary.Account
Dim fso As New FileSystemObject
Dim flds As Folders

Dim ogwFolder As Folder, _
ogwFoundFolder As Folder, _
i As Long, _
StartCount1 As Long, _
StartCount2 As Long, _
sCommandOptions As String, _
sMailPassword As String, _
sLoginName As String, _
sFolderToSearch As String, _
sFileType As String, _
sSavePath As String, _
ogwMail As Mail, _
aryTo() As String, _
aryCC() As String, _
aryBCC() As String



'If ogwApp Is Nothing Then 'Need to set object reference
'DoEvents
Set ogwApp = CreateObject("NovellGroupWareSession")
DoEvents
'End If


Set ogwRootAcct = ogwApp.Login
DoEvents
sFolderToSearch = "Work In Progress"

Set MyWorkFolder = ogwRootAcct.AllFolders.ItemByName(sFolderToSearch)
Set MyMessages = MyWorkFolder.Messages
Set MyDraftMsg = MyMessages.Add()
MyDraftMsg.Recipients.Add ("Raj.Pov@XXXcvc.com")
With MyDraftMsg
'Assign the SUBJECT text
' .Subject = StrSubject
'Assign the BODY text
' .Priority = egwLow

' .BodyText = StrBody


'
End With
'
'Release all objects before closing
Set ogwRootAcct = Nothing
Set ogwApp = Nothing
DoEvents

End Sub