?
Solved

Single Quotes around email address create from a Macro in Access

Posted on 2007-11-21
13
Medium Priority
?
1,330 Views
Last Modified: 2013-11-27
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
Comment
Question by:kdr2003
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
  • 3
13 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 20329342
you can eliminate them using the vba Replace function

Replace(vString,chr(39),"")
0
 

Author Comment

by:kdr2003
ID: 20330259
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
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 20330578
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 44

Expert Comment

by:GRayL
ID: 20330938
Why is that happening in the first place?  What does the macro do?
0
 

Author Comment

by:kdr2003
ID: 20331242
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
 
LVL 44

Expert Comment

by:GRayL
ID: 20331560
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
 

Author Comment

by:kdr2003
ID: 20331980
GRayL:
              You get a compile error if you remove the quotes.

Ken
0
 
LVL 44

Expert Comment

by:GRayL
ID: 20332336
Are you saying a compile error if you remove the empty double quotes between the two commas?
0
 

Author Comment

by:kdr2003
ID: 20340021
Yes GrayL
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 20340073
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
 

Author Comment

by:kdr2003
ID: 20340841
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
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 20358532
kdr2003,
tried to reproduce the error you are getting but i couldn't.

try posting the problem to the Outlook TA.
0
 

Accepted Solution

by:
kdr2003 earned 0 total points
ID: 20385994
I solved the problem by creating a outlook rule with recipients email addresses without quotes.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question