I tried using this macro that I found on the web and it tells me "User defined type not defined" and points to "objGW As GoupwareTypeLibrary.Application". I thought that this was defined with the Dim statement below?
Here is the macro...
Thank you.
Here is the macro...
Code:
Sub send_mail()
DoCmd.Hourglass True
Dim strFrom, strSubject, strBody
Dim objGW As GroupwareTypeLibrary.Application "
[COLOR=green]' Type in the Subject here. 'Pretty self explanatory[/COLOR]
strSubject = "Subject Text"
[COLOR=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.[/COLOR]
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"
[COLOR=#000000]End With
End With
.Quit
End With
Set objGW = Nothing[/COLOR]
[COLOR=green]' Turn the hourglass off[/COLOR]
DoCmd.Hourglass = False
End Sub
Thank you.