Sending email from Outlook group box with Access VBA

Sending email from Outlook group box with Access VBA

am 20.12.2007 00:54:47 von seanhirshberg

I have code that current sends spreadsheets by email from a user's
Outlook. I need to modify the code to send the email from their group
email box, so the recipient can respond to the group email. Any ideas
how I could do that? Here is part of my code:

If qda.EOF = False And qda.BOF = False Then

qda.MoveFirst

Do While qda.EOF = False

autoFCinput = qda.Fields("Pull FCs").Value

qda.MoveNext

FCFileName = "c:\FC_Perf_" & autoFCinput & ".xls"

FCInput = "'" & autoFCinput & "'"

Set qds = dbs.OpenRecordset("SELECT emailAddress FROM FCAddressBook
where FCCodeEmail = " & FCInput & ";")

FCAddress = qds.Fields("emailAddress").Value

strSQL = "SELECT * FROM otherAccounts WHERE InputSource = 'FC
Input' AND FCCode = " & FCInput & "AND format(ImportDate,'m/dd/yyyy')
=" & "'" & importDate & "'" & ";"

Set qdf = dbs.CreateQueryDef("FC OUTPUT QUERY", strSQL)

strMsg = "XXX"

DoCmd.SendObject acSendQuery, "FC OUTPUT QUERY", "*.xls",
FCAddress, , , "Urgent: Consolidated Statement Info.", strMsg, False

DoCmd.DeleteObject acQuery, "FC OUTPUT QUERY"

Loop

End If

Thanks!

Re: Sending email from Outlook group box with Access VBA

am 21.12.2007 04:05:27 von Tony Toews

seanhirshberg@yahoo.com wrote:

>I have code that current sends spreadsheets by email from a user's
>Outlook. I need to modify the code to send the email from their group
>email box, so the recipient can respond to the group email. Any ideas
>how I could do that? Here is part of my code:

I vaguelly recall something about Outlook Profiles that might solve your problem.
Here's some info at a web page: http://www.slipstick.com/outlook/profile.htm. I
suspect the user will be required to exit Outlook and start it with the proper
priofile.

You may be best going to a SMTP solution and bypassing Outlook completely. I'm
assuming that your corporations IT department will allow port 25 access to your
Exchange server. However this can involve importing lots of rather ugly code
although you may not have to deal with the guts of it much.

http://www.granite.ab.ca/access/email/winsock.htm

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/