Ken
asked on
Single Quotes around email address create from a Macro in Access
Access or Outlook is placing a single quotes around email addresses I have in a macro in Access. The problem is that people are not receiving the emails when quotes are around the email address. How can I get rid of the quotes.
thks
Ken
thks
Ken
ASKER
Hi Capricorn1,
Where would I use this function when I am just placing the email addresses in the macro using send output?
Thks
Ken
Where would I use this function when I am just placing the email addresses in the macro using send output?
Thks
Ken
you can convert that macro into VBA codes. using VBA codes you will have more flexibility
Tools>Macro>convert macros to visual basic
after the conversion post the converted codes here and we will see where we could insert the Replace function
Tools>Macro>convert macros to visual basic
after the conversion post the converted codes here and we will see where we could insert the Replace function
Why is that happening in the first place? What does the macro do?
ASKER
Thanks Capricorn1:
Below is the code:
Option Compare Database
'------------------------- ---------- ---------- ---------- -----
' OrderExpressEmailPaidTrans actions
'
'------------------------- ---------- ---------- ---------- -----
Function OrderExpressEmailPaidTrans actions()
On Error GoTo OrderExpressEmailPaidTrans actions_Er r
DoCmd.OpenForm "OrderExpress Paid Dates", acNormal, "", "", , acNormal
DoCmd.SendObject acReport, "Order Express Paid Transactions", "SnapshotFormat(*.snp)", "samuel.ramirez@orderexpre ss.com.mx; tesoreria@ orderexpre ss.com.mx; martin.mar tinez@orde rexpress.c om.mx", "Kenneth.D.Rosak@citi.com; Jesus.Guer rero@citi. com;yescen ia.c.arell ano@citi.c om;ariadna .b.ortiz@c iti.com;ce lina.e.eva ns@citi.co m", "", "Order Express Paid Transactions", "", False, ""
DoCmd.Close acForm, "AFEX Paid Dates"
DoCmd.Quit acExit
OrderExpressEmailPaidTrans actions_Ex it:
Exit Function
OrderExpressEmailPaidTrans actions_Er r:
MsgBox Error$
Resume OrderExpressEmailPaidTrans actions_Ex it
End Function
Below is the code:
Option Compare Database
'-------------------------
' OrderExpressEmailPaidTrans
'
'-------------------------
Function OrderExpressEmailPaidTrans
On Error GoTo OrderExpressEmailPaidTrans
DoCmd.OpenForm "OrderExpress Paid Dates", acNormal, "", "", , acNormal
DoCmd.SendObject acReport, "Order Express Paid Transactions", "SnapshotFormat(*.snp)", "samuel.ramirez@orderexpre
DoCmd.Close acForm, "AFEX Paid Dates"
DoCmd.Quit acExit
OrderExpressEmailPaidTrans
Exit Function
OrderExpressEmailPaidTrans
MsgBox Error$
Resume OrderExpressEmailPaidTrans
End Function
My point is - with that sendobject command, there should not be any single quotes around individual email addresses.
DoCmd.SendObject [objecttype][, objectname][, outputformat][, to][, cc][, bcc][, subject][, messagetext][, editmessage][, templatefile]
It appears there should be nothing between the commas following the [cc]. Try removing the pair of double quotes leaving just two commas.
DoCmd.SendObject [objecttype][, objectname][, outputformat][, to][, cc][, bcc][, subject][, messagetext][, editmessage][, templatefile]
It appears there should be nothing between the commas following the [cc]. Try removing the pair of double quotes leaving just two commas.
ASKER
GRayL:
You get a compile error if you remove the quotes.
Ken
You get a compile error if you remove the quotes.
Ken
Are you saying a compile error if you remove the empty double quotes between the two commas?
ASKER
Yes GrayL
those quotes are required for the email addresses.
your codes looks good and i don't see anything that can cause the single quote to be inserted, the single quote must be generated by Outlook (not sure though)
can you post here the generated email addresses with single quotes.
your codes looks good and i don't see anything that can cause the single quote to be inserted, the single quote must be generated by Outlook (not sure though)
can you post here the generated email addresses with single quotes.
ASKER
From: Rosak, Kenneth
Sent: Friday, November 23, 2007 4:16 AM
To: 'samuel.ramirez@orderexpre ss.com.mx' ;
'tesoreria@orderexpress.co m.mx'; 'martin.martinez@orderexpr ess.com.mx '
Cc: 'Kenneth.D.Rosak@citi.com' ; 'Jesus.Guerrero@citi.com';
'yescenia.c.arellano@citi. com'; 'ariadna.b.ortiz@citi.com' ;
'celina.e.evans@citi.com'
Subject: Order Express Paid Transactions Holiday
Attachments: Order Express Paid Transactions.snp
Sent: Friday, November 23, 2007 4:16 AM
To: 'samuel.ramirez@orderexpre
'tesoreria@orderexpress.co
Cc: 'Kenneth.D.Rosak@citi.com'
'yescenia.c.arellano@citi.
'celina.e.evans@citi.com'
Subject: Order Express Paid Transactions Holiday
Attachments: Order Express Paid Transactions.snp
kdr2003,
tried to reproduce the error you are getting but i couldn't.
try posting the problem to the Outlook TA.
tried to reproduce the error you are getting but i couldn't.
try posting the problem to the Outlook TA.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Replace(vString,chr(39),""