Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    dmcmillo is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    13

    Question How do i attach the bound object frame to the body of email?

    Hello Everyone. I'm having a very tough time trying to figure out how to get this to work. Please help????

    My email comes out like this:
    Click image for larger version. 

Name:	Access.JPG 
Views:	11 
Size:	32.1 KB 
ID:	22429




    here's my code:

    Private Sub Complete_Click()
    Dim OL As Outlook.Application

    Dim MyItem As Outlook.MailItem

    Dim sHTML As String
    Dim sSubject As String

    Dim sTo As String
    Dim sCC As String



    'Dont forget to specifiy the references for the object library
    'This is the body of the email, the "<br><br><br> are breaks for the html

    sHTML = "<html><body> Collation Team," & "<br><br><br> " & "AutoRelease priorities have been chnaged to the below settings." & "<br><br><br> " & "Reason" & "<br><br><br> " & _
    "New Settings" & "<br><br><br> " & "" & " <br></body></html>"


    sSubject = "Collation AutoRelease Priority Change"
    'sTo = ""
    'sCC = ""
    'calls the function to email
    Call SendEMail(sTo, sCC, sSubject, sHTML)



    End Sub

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Where do you want the Reason text to come from? A textbox on form?

    AFAIK, the image must come from an external file using <img> tags.

    sHTML = "<html><body>Collation Team,<br><br><br>AutoRelease priorities have been changed to the below settings.<br><br><br>Reason: " & Me.textboxname & "<br><br><br>" _
    "New Settings:<br><br><br><img src='filepath/imagename' alt='some text' style='width:145px;height:126px;'></body></html>"
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    dmcmillo is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    13

    Question

    Quote Originally Posted by June7 View Post
    Where do you want the Reason text to come from? A textbox on form?

    AFAIK, the image must come from an external file using <img> tags.

    sHTML = "<html><body>Collation Team,<br><br><br>AutoRelease priorities have been changed to the below settings.<br><br><br>Reason: " & Me.textboxname & "<br><br><br>" _
    "New Settings:<br><br><br><img src='filepath/imagename' alt='some text' style='width:145px;height:126px;'></body></html>"

    I want the reason text to come from a text box on the form.

    I added the syntax from the modified code you added here. I get a problem now with the image. Shows a x image. Am i not refernceing everything i need to?

    Click image for larger version. 

Name:	ImageTest.JPG 
Views:	8 
Size:	18.0 KB 
ID:	22442Click image for larger version. 

Name:	References.JPG 
Views:	8 
Size:	39.4 KB 
ID:	22443

    sHTML = "<html><body> Collation Team," & "<br><br><br> " & "AutoRelease priorities have been changed to the below settings." & "<br><br><br> " & "Reason:" & Me.Reason & " <br><br><br> " & _
    "New Settings:" & "<br><br><br> <img src='filepath/imagename' alt='some text' style='width:145px;height:126px;'></body></html>"

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Well, you must use some actual filepath and image filename from your computer in place of the example 'filepath/imagename'.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    dmcmillo is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    13
    That may be my problem. I was trying to just paste an image in the bound object frame. I figured this would be easier as there can be many variations of the image that is pasted. Is there a way?

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Pasting image into object frame (https://www.accessforums.net/modules...ect-27704.html) will not resolve including image in email.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    dmcmillo is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    13
    This doesn't help me. I rather not have to call for excel to paste the image. Is there a way i paste a random image into a field (If not bound object frame then What>) and send it with the text in my email???

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Again, only method I think available is to attach to email external image file.

    I posted that link because it seemed to lead to an Access VBA solution for pasting image into object frame.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #9
    dmcmillo is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    13
    OK Np i follow you now. I'm trying to get away from the million Spreadsheets we use right now. I will continue to look, that may be an option down the road. Thanks!

  10. #10
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Doesn't matter how you get image into object frame. It won't help get image attached to email.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  11. #11
    dmcmillo is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    13
    Quote Originally Posted by June7 View Post
    Doesn't matter how you get image into object frame. It won't help get image attached to email.
    So is the only way to go the excel route to get the image in body of email???

  12. #12
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    That Excel link has nothing to do with attaching image to email. It was about getting image into object frame. Image must be an external file for attaching to email.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  13. #13
    dmcmillo is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    13
    Quote Originally Posted by June7 View Post
    That Excel link has nothing to do with attaching image to email. It was about getting image into object frame. Image must be an external file for attaching to email.
    ok i feeling completely lost now. Forgive me. Please walk me through this method if you have time...

  14. #14
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Walk you through what - attaching external image file to email? I already gave example code for that in post 2.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  15. #15
    dmcmillo is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    13
    Ok yeah i remember that example and i tried it. Even with the source location and filename. still got the image with x. how do i fix that?

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Bound Object Frame
    By bigguy in forum Forms
    Replies: 4
    Last Post: 04-15-2015, 03:14 PM
  2. Bound Object Frame Combo sorted Results
    By kevsim in forum Programming
    Replies: 7
    Last Post: 01-08-2011, 06:30 PM
  3. Replies: 2
    Last Post: 10-18-2010, 07:53 AM
  4. Replies: 1
    Last Post: 08-05-2010, 12:11 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums