I'm looking to have Acess 2000 to take a report and automaticly email a report at 7:00. Is this possible or is there an easier more logical way of doing this.
Thank You
Ken Devorak
Printable View
I'm looking to have Acess 2000 to take a report and automaticly email a report at 7:00. Is this possible or is there an easier more logical way of doing this.
Thank You
Ken Devorak
Access cannot do this because a database is not an application. Your best bet would be to create an application in VB that does the mailing, then add it to a system schedular.
I am attempting to do this also...I am using the MAPI controls with VB. I can get the attachments and such added to the email..but, I am having problems with my address. If i type in the address it will work fine...but If I code the addressee and his address into my app....i get a returned mail message saying that there is no provider for transfer error. Any suggestions?
post the code you are using to create the file. Let's all take a look and see what's up!
Below is the code i am currently using...Thanks for the help (prematurely!)
Public Sub Send_File()
MAPISession1.SignOn
MAPIMessages1.SessionID = MAPISession1.SessionID
MAPIMessages1.MsgIndex = -1
MAPIMessages1.Compose
MAPIMessages1.RecipDisplayName = "John Doe"
MAPIMessages1.RecipAddress = "[email protected]"
MAPIMessages1.RecipType = 1
MsgBox (MAPIMessages1.RecipCount)
MAPIMessages1.RecipIndex = 0
MAPIMessages1.MsgSubject = "Test of the Report"
MAPIMessages1.MsgNoteText = "i hope this works"
'MAPIMessages1.AttachmentPathName = m_sFName
MAPIMessages1.Send True
MAPISession1.SignOff
End Sub
I can't see anything funky there. Anyone?
You might try popping up a message box with the value of
MAPIMessages1.RecipAddress
and make sure it is right. You said it works when you prompt for the addy.
Also, I only noticed one address... Make sure you have both a to and from addy.
Try poking your nose into http://www.vbcode.com and see if somebody has a routine written up there for download or at least so you can look at how they did it.
My experience with MAPI is that it is tempermental...
Try this:
Also, make sure you set your references to include the Microsoft Outlook 98 Object Model...Code:Private Sub Command1_Click()
Dim oOutlookApp As Outlook.Application
Dim oMailItem As Outlook.MailItem
Dim strHTML As String
strHTML = "This is an E-mail Test" & _
"<br><br>" & _
"<b>PLEASE NOTE:</b> This is only a test" & _
"<br><br>" & _
"Visit my website at : <a href='http://alphaprime.mine.nu'>http://alphaprime.mine.nu</a>" & _
"<br><br>Thank You!!"
Set oOutlookApp = New Outlook.Application
Set oMailItem = oOutlookApp.CreateItem(olMailItem)
Call oMailItem.Recipients.Add("[email protected]")
oMailItem.Subject = "Test"
oMailItem.HTMLBody = strHTML
'oMailItem.Attachments.Add "c:\add an attachment here..."
oMailItem.Send
Set oMailItem = Nothing
Set oOutlookApp = Nothing
End Sub
In your HTML, where you would normally use quotes (") use ticks (') or it won't work...