Results 1 to 11 of 11
  1. #1
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Nevada, USA
    Posts
    207
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I’ve written VBA code to send a mass mailing email that contains an embedded image (a jpg logo). I tested the code on my own computer using Outlook 2007. Everything works perfectly.

    The problem I’m having is that when I installed it on the user’s computer, which has Outlook 2003 installed, the message is sent out and received but the embedded image is not received. The message appears perfectly in the Sent Items folder, including the image . Upon receipt, however, instead of the image, the dreaded red x appears. I Googled this and tried changing a few Outlook 2003 settings but nothing works.

    I'm thinking that it appears fine in the Sent Items folder because the image is physically on that C: drive. What settings control this?

    Any ideas? Thanks, in advance.
    Carol W.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    What code do you use to embed the image?

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    [quote name='WSC' post='787960' date='07-Aug-2009 12:00']Upon receipt, however, instead of the image, the dreaded red x appears. I Googled this and tried changing a few Outlook 2003 settings but nothing works.[/quote]
    If you view the source of a message where the image does not appear, does the <img> tag have a src attribute similar to src="cid:image..."? That usually indicates that the image was embedded rather than merely linked, and was bundled into the message as an attachment.

  4. #4
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Nevada, USA
    Posts
    207
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='HansV' post='787963' date='07-Aug-2009 12:07']What code do you use to embed the image?[/quote]

    Thanks for the reply. Here is my code. Strpath is the path in which the jpg file is located. The commented out strpath = statement is the path on my computer.
    ************************************************** ***********************
    Public Sub SendMessage()
    Dim strbcc As String
    Dim strmsg As String

    Dim dbsmember As Database
    Dim rstvols As Recordset

    Set dbsmember = CurrentDb()
    Set rstvols = _
    dbsmember.OpenRecordset("qry-email alone for broadcast message", dbOpenDynaset)
    On Error GoTo err1


    strbcc = ""
    Forms![BroadcastMessageSubmenu].strerrmsg = ""

    rstvols.MoveFirst
    intnumvols = 0


    Do While Not rstvols.EOF
    With rstvols
    If Not IsNull(![CV Email]) Then
    strbcc = strbcc & ![CV Email] & ";"
    intnumvols = intnumvols + 1
    End If
    End With
    rstvols.MoveNext
    Loop

    Set rstvols = Nothing

    If intnumvols = 0 Then
    GoTo err1
    End If

    'strpath = "D:\My Documents\ALLV\Logos\"
    strpath = "C:\Documents and Settings\All Users\Documents\Logos\"

    strmsg = "<p style=""line-height: 80%; word-spacing: 0; margin-top: -1; margin-bottom: -36px""> <img border=""0"" src = ""file:///" & strpath & "LasVegas.3color.jpg"" width=""103"" height=""86""><font face=""Arial"" size=""4"">Following is a message from Assistance League® of Las Vegas:</font></p>"
    'strmsg = strmsg & "<img width=339 height=254 src = " & strpath & "LasVegas.3color" > ""

    Dim strEmail, strSubject As String, strBody As String
    Dim objOutlook As Outlook.Application
    Dim objEmail As Outlook.MailItem

    Set objOutlook = CreateObject("Outlook.application", "localhost")
    Set objEmail = objOutlook.CreateItem(olMailItem)

    'strEmail = " a @ b.c"
    'strBody = "Make this bold and add a line."
    'strSubject = "Subject"
    With objEmail
    .BCC = strbcc
    .Subject = "Enter Message Subject to Volunteers here"
    .HTMLBody = strmsg
    '.Send 'Will cause warning message
    .Display
    End With

    Set objEmail = Nothing
    Exit Sub



    err1:
    Forms![BroadcastMessageSubmenu].strerrmsg = "No members found in this group. No email message will be generated."
    Exit Sub
    End Sub
    Carol W.

  5. #5
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Nevada, USA
    Posts
    207
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='jscher2000' post='787972' date='07-Aug-2009 12:36']If you view the source of a message where the image does not appear, does the <img> tag have a src attribute similar to src="cid:image..."? That usually indicates that the image was embedded rather than merely linked, and was bundled into the message as an attachment.[/quote]

    Thanks for the reply. Here is the src = statement obtained by viewing source on the received message:

    src="file:///C:\Documents%20and%20Settings\All%20Users\Document s\Logos\LasVegas.3color.jpg"
    Carol W.

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    As you can see, the img tags refer to files on your hard disk, so they are linked, not embedded. Hence the recipient won't be able to view them.

    See To add an embedded image to an HTML message in Microsoft Outlook using code for the code you need to embed an image instead of linking it.

  7. #7
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Nevada, USA
    Posts
    207
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='HansV' post='787981' date='07-Aug-2009 13:07']As you can see, the img tags refer to files on your hard disk, so they are linked, not embedded. Hence the recipient won't be able to view them.

    See To add an embedded image to an HTML message in Microsoft Outlook using code for the code you need to embed an image instead of linking it.[/quote]

    Thanks, Hans. I'll give this a try.

    Several additional points/questions:

    1 - When I did the original testing using Outlook 2007 and the code I posted, I sent the message to two other individuals beside myself. Both of them received the image. Any idea why?

    2 - Will the code you provided attach the image or embed it in the message? The requirement is for it to be embedded in the message, not attached.

    Thanks.
    Carol W.

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    1. I have no idea, sorry.

    2. The code I posted a link to will embed the image in the body of the e-mail message.

  9. #9
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Nevada, USA
    Posts
    207
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I wanted to give you both an update on my workaround to this issue.

    I missed an obvious solution yesterday - i.e. use src = "http://.......". So, I uploaded the image to the organization's website and used the following two lines of code:

    strpath = "http://allv.org/imageDisplay/0601544LasVegas.3color.jpg"

    strmsg = "<img border=""0"" src = " & strpath & " width=""103"" height=""86""><font face=""Arial"" size=""4"">Following is a message from Assistance League® of Las Vegas:</font></p>"

    Of course, it takes a fraction of a second longer for the image to appear in the Outlook window but the image is received by all recipients.

    Thanks, again, for your replies.
    Carol W.

  10. #10
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    A link to a public website should work, but some recipients may be prompted to allow images to be displayed.

  11. #11
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Nevada, USA
    Posts
    207
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='HansV' post='788070' date='08-Aug-2009 08:47']A link to a public website should work, but some recipients may be prompted to allow images to be displayed.[/quote]

    Thanks, Hans, as always.

    I'll keep that in mind if the issue comes up.
    Carol W.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •