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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access to Groupwise email thru a macro 1

Status
Not open for further replies.

TheAnimal

Programmer
May 18, 2002
15
0
0
US
I have an Access report that I want to send (via Groupwise email) to various users. I have a macro that uses the SendObject command.
Everything works fine on the development PC (14 recipients). When the application is used by various users on various PC's the results are varied. Both 2000 and XP machines will send to all 14.
One PC (2000) will send only to the Last recipient on the Send to line and the CC line (2 recipients, 14 listed).
On one PC (2000) we had luck updating the Groupwise and updating the Novell Client. We did the same to the other PC with no changes in the outcome.
I have tried changing the list seperator, and tested with each recipient. Still no change, only the Last recipient in each list (2/14 recipients).
Access 97, Novell 6.5, Groupwise 6.5, Windows 2000.
Any help with this would be appricated. Thanks
 
What is the VBA code are you using? I have code that does this, but I don't use SendObject.

[tt]_____
[blue]-John[/blue]
[/tt][red]Quidquid latine dictum sit, altum viditur[/red]

Help us help you. Please read FAQ181-2886 before posting.
 
I don't use VBA I've used the macro. I'll post the exact cmds. tomorrow 08/05/05.
 
The macro that I use is:


Open Report (this opens the print preview)
SendObject (allows for the the email data)
Close (Closes the print preview)
Stop Macro (Ends the macro)

The email address' are listed in the options boxes of the Send Object command.
 
I honestly don't know why that would be happening to you. But if you're interested, on Monday I'll post some VBA I use to accomplish this. You can copy and paste it into an Access module. Taking this approach might get around the problem, even if it doesn't answer why this is happening.

[tt]_____
[blue]-John[/blue]
[/tt][red]Quidquid latine dictum sit, altum viditur[/red]

Help us help you. Please read FAQ181-2886 before posting.
 
Thank you any help would be greatly appreciated.
 
Sorry, I got a little distracted here at work and forgot to post the code. Here's how I do it:
Code:
Sub send_mail()
[green]'*********************************************
'Written by:    John Helsabeck
'Written on:    08/31/04
'*********************************************

'   Turn on the hourglass in Access to indicate that it is busy[/green]
DoCmd.Hourglass True

Dim strFrom, strSubject, strBody
Dim objGW As GroupwareTypeLibrary.Application

[green]'   This field is optional. You can type in an Alias for the 'From' field if you want. This acts just like
'going into the 'From' field of an email and typing something in. When using this option, I include a lot
'of extra spaces at the end so my real name doesn't appear in quotes on the recipients screen[/green]
strFrom = "From text if desired                                                                        " & _
"                                                                                                      " & _
"                                                                                                      " & _
"                                                                                                      "

[green]'   Type in the Subject here. 'Pretty self explanatory[/green]
strSubject = "Subject Text"

[green]'   One of the perks of using code is that you can include body text.
'You can include returns in the body of the email by using 'Chr(10)'.
'You can indent text by using 'Chr(9)', which is a single tab.[/green]
strBody = "Body text." & Chr(10) & Chr(10) & _
    Chr(9) & "This text will be separated by returns and a tab."

Set objGW = New GroupwareTypeLibrary.Application

    With objGW
        With .Login
            With .MailBox.Messages.Add(Class:="GW.MESSAGE.MAIL")
                .Subject.PlainText = strSubject
                .Bodytext.PlainText = strBody
                .FromText = strFrom
                .Attachments.Add "C:\FilePath\File_Name.xls"
                .Recipients.Add "someone@somewhere.com"
                .Recipients.Add "Distribution Group"
[green]                        'I include this because I've had problems with the macro hanging up when sending
                        'several emails in a row. If you are sending a single email, you can leave out this
                        'section. On my PC, counting to 25,000 takes about 15 seconds - but you may want to
                        'adjust the number based on your processor speed.
                    'For i = 1 To 250000
                    '    DoEvents
                    'Next i[/green]
                .Send
            End With
        End With
        .Quit
    End With
    Set objGW = Nothing

[green]'   Have message box pop up to let you know that the procedure is complete[/green]
MsgBox "Email has been sent!", vbInformation, "Email Notification"

[green]'   Turn the hourglass off[/green]
DoCmd.Hourglass = False
End Sub
Just copy and paste that into an Access module.

[tt]_____
[blue]-John[/blue]
[/tt][red]Quidquid latine dictum sit, altum viditur[/red]

Help us help you. Please read FAQ181-2886 before posting.
 
Thank you very much for your time and effort. I'll try this over the next weekend and week ahead.

This macro doesn't just send an email. With the Send Object it asks for an object and the type of document to send. I have an Access report (.rtf) that I want to attach to the email notification.

Can that also be attached via the code?
 
Never mind about the attachment I found that in the vba you sent.

Thank you very muchfor your time this has helped a great deal.

Kent
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top