Sending email from Outlook group box with Access VBA
am 20.12.2007 00:54:47 von seanhirshbergI 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!