• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1350
  • Last Modified:

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
0
kdr2003
Asked:
kdr2003
  • 6
  • 4
  • 3
1 Solution
 
Rey Obrero (Capricorn1)Commented:
you can eliminate them using the vba Replace function

Replace(vString,chr(39),"")
0
 
kdr2003Author Commented:
Hi Capricorn1,
                        Where would I use this function when I am just placing the email addresses in the macro using send output?

Thks
Ken
0
 
Rey Obrero (Capricorn1)Commented:
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
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
GRayLCommented:
Why is that happening in the first place?  What does the macro do?
0
 
kdr2003Author Commented:
Thanks Capricorn1:

Below is the code:

Option Compare Database

'------------------------------------------------------------
' OrderExpressEmailPaidTransactions
'
'------------------------------------------------------------
Function OrderExpressEmailPaidTransactions()
On Error GoTo OrderExpressEmailPaidTransactions_Err

    DoCmd.OpenForm "OrderExpress Paid Dates", acNormal, "", "", , acNormal
    DoCmd.SendObject acReport, "Order Express Paid Transactions", "SnapshotFormat(*.snp)", "samuel.ramirez@orderexpress.com.mx;tesoreria@orderexpress.com.mx;martin.martinez@orderexpress.com.mx", "Kenneth.D.Rosak@citi.com;Jesus.Guerrero@citi.com;yescenia.c.arellano@citi.com;ariadna.b.ortiz@citi.com;celina.e.evans@citi.com", "", "Order Express Paid Transactions", "", False, ""
    DoCmd.Close acForm, "AFEX Paid Dates"
    DoCmd.Quit acExit


OrderExpressEmailPaidTransactions_Exit:
    Exit Function

OrderExpressEmailPaidTransactions_Err:
    MsgBox Error$
    Resume OrderExpressEmailPaidTransactions_Exit

End Function

0
 
GRayLCommented:
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.
0
 
kdr2003Author Commented:
GRayL:
              You get a compile error if you remove the quotes.

Ken
0
 
GRayLCommented:
Are you saying a compile error if you remove the empty double quotes between the two commas?
0
 
kdr2003Author Commented:
Yes GrayL
0
 
Rey Obrero (Capricorn1)Commented:
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.
0
 
kdr2003Author Commented:
From: Rosak, Kenneth
Sent: Friday, November 23, 2007 4:16 AM
To: 'samuel.ramirez@orderexpress.com.mx';
'tesoreria@orderexpress.com.mx'; 'martin.martinez@orderexpress.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
0
 
Rey Obrero (Capricorn1)Commented:
kdr2003,
tried to reproduce the error you are getting but i couldn't.

try posting the problem to the Outlook TA.
0
 
kdr2003Author Commented:
I solved the problem by creating a outlook rule with recipients email addresses without quotes.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 6
  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now