Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA code to send Email through Groupwise 3

Status
Not open for further replies.

cchristi

Programmer
Sep 29, 2003
14
US
By searching the net, I have been able to put
together some code to automate sending Access
reports via Groupwise attachments. The one
problem still unsolved is trying to attach another
recipient as a .BC, or as a .CC

Does anyone know the code? The code to attach
the 'To:' recipient is:
objectname.Recipients.Add strContactEmail

I had heard that:
objectname.Recipients.Add strContactEmail, egwBC
was the way to go, but it doesn't work for me.
:confused;
 
Are you using Dmitri Furman's GW class module? If not, it's available here:


It might help get you going in the right direction. I'm hoping to use it myself soon, as I want to be able to send appointments to the GW calendar from within an Access database. Kinda makes my brain hurt to think about it, though...

Ken S.
 
Thanks HenryAnthony and Eupher!

I struggled with SendObject for several hours yesterday and it wasn't compatible with the rest of my code. Also, it doesn't allow sending in .snp format. Who wants to completely rewrite their code anyway? [wink]

Eupher, I am so excited about Dmitri Furman's GW class module! It contains almost all of the syntax that I am using, the .BC and .CC and SO MUCH MORE.

Thank you, Thank you, Thank you, Thank you, Thank you!
[reading] [reading] [reading] [reading]

 
Not familiar with .snp but sendobject works fine in Group Wise 6.0.2. cc, bc, attachments all work.

Best regards,

Henry
 
Henry, do you know if it's possible to send GW appointments with SendObject? If so, how? Thanks!

Ken S.
 
Ken, to the best of my knowledge, sendobject is designed to send an Access database object via an email. I use it to send a status report in text format to a predefined list of recipients. I also have some code that will send to a list derived from a query. I don't know of any way to send an appointment but that doesn't mean it can't be done. You might want to start up a new thread.

Best regards,

Henry
 
Eupher, my code sends a 'Task'. It can't be that different to send an appointment. As a trial I changed the dim to 'Appointment3' and ("GW.MESSAGE.TASK") to ("GW.MESSAGE.APPOINTMENT") and commented out some lines that were clearly pertaining to sending a task. It worked, except that you would need to add some lines on appt times etc.

If you can't get SendObject to work, try this.

GW Library Items are required
'/*****************************************************
Public Function StartExport()
Application.Echo True, "Creating Email"
DoCmd.SelectObject acForm, "Mail Letters"

Dim objGWApp As Object
Dim objGWAcct As Object
Dim objGWmsg As Object
Dim objGWTask As Task3
Dim strContactEmail, strBody, strSubject, strExm As String
' set contact email address to variable
strContactEmail = Me.hylkEmail.Value
'set body of email to variable
strBody = "To: " & Me.txtCoContact & Chr(10) _
& " " & Me.txtCoName & Chr(10) _
& " " & Me.txtAdd1 & Chr(10) _
& " " & Me.txtCityStZip & Chr(10) & Chr(10) _
& "your text here.

strSubject = ""

On Error GoTo ErrHandler
' create new email
Set objGWApp = CreateObject("NovellGroupWareSession")
Set objGWAcct = objGWApp.Login("FAFilings", "password")
Set objGWmsg = objGWAcct.MailBox.Messages
Set objGWmsg = objGWmsg.Add()
'if cboltrtype is FAX, then skip the send
objGWmsg.FromText = ""
objGWmsg.Recipients.Add strContactEmail
End If
objGWmsg.BodyText = strBody
objGWmsg.Subject = strSubject
objGWmsg.Recipients.Add "", , 2
objGWmsg.Attachments.Add strCoverLtr
objGWmsg.Send

'add a new task object to the calendar
Set objGWTask = objGWAcct.Calendar.Messages.Add("GW.MESSAGE.TASK")
objGWTask.OnCalendar = True

'set the properties of the message object
objGWTask.FromText = ""
objGWTask.Recipients.Add ""
objGWTask.Recipients.Resolve
objGWTask.StartDate = Format(Now(), "short date")
objGWTask.DueDate = Format(Now() + 20, "short date")
objGWTask.Subject = Me.txtCoName
objGWTask.BodyText = strSubject & " ; " & Format(Now(), "short date")
objGWTask.NotifyWhenAccepted = egwNotify
objGWTask.NotifyWhenDeclined = egwNotify

'Send the task message
objGWTask.Send

On Error Resume Next
Set objGWApp = Nothing
Set objGWmsg = Nothing
Set objGWAcct = Nothing
Set objGWTask = Nothing

Exit Function

ExitHere:
Exit Function

ErrHandler:
Err.Raise Err.Number, Err.Source, Err.DESCRIPTION
Resume ExitHere
End Function
 
Outstanding! This is just what I was looking for. I've been wading through the Groupwise API and Dmitri Furman's GW class module, but hadn't gotten very far yet. The API is a lot to wrap your brain around, and the class module just seems like overkill for my needs - and it doesn't really address appointments (I suppose that could be added easily enough). The idea is just to send appointments to a GW account which is set up solely for the purpose of maintaining a master schedule, then giving everybody in the office read-only proxy access to the calendar. I haven't tried it yet, but my impression is that your code will do what I need with a minimum of tweaking. Thanks!

Ken S.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top