Page 2 of 2 FirstFirst 12
Results 16 to 17 of 17
  1. #16
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,574
    Well if you want each image in it's own table (and I am puzzled as to why ), then you do need multiple table tags.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  2. #17
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,371
    Hi June7, this is working exact now, thanks to all, as Minty mentioned, yes I do appear to loose myself where to initiate loops and that's probably why I struggle to get the result without hard coding that's 4 miles long!!!!

    and WGM yes i should write down the goal, then write down procedures then tackle the vba

    anyhow, this works exact now thank you all

    Code:
    sPath = "T:\DMT Ltd\Cam Images\"sFiles = Dir(sPath & "*.jpg")
    
    
    
    
        Set myItem = myapp.CreateItem(olMailItem)
        Set OutAccount = myapp.Session.Accounts.Item(1)
        With myItem
    
    
    Do While sFiles <> ""
        
        strEmailImages = strEmailImages & _
        "<table style='text-align:left;border:3px solid blue;font-family:calibri;border-collapse:collapse;padding:5px'><br>" & _
            "<font color='blue' font face='Times New Roman' size='3'>Image Name:<B> " & Replace(sFiles, ".jpg", "") & "</B></font>" & _
            "<P><IMG border=2 hspace=0 alt='' src='file:" & sPath & sFiles & "' align=baseline></P>" & "<br>" & _
        "</table><br>"
        
        strIntro = "Please find images we have taken:"
        
        strSubj = strSubj & Replace(sFiles, ".jpg", "") & " - "
        
        sFiles = Dir
        
    Loop
    
    
        .To = ""
        .subject = strSubj
        .HTMLBody = strIntro & "<br>" & strEmailImages
        .Display
    End With

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

Similar Threads

  1. Replies: 6
    Last Post: 01-01-2021, 08:50 AM
  2. Replies: 4
    Last Post: 04-10-2019, 06:15 PM
  3. Replies: 22
    Last Post: 05-14-2018, 05:24 PM
  4. Replies: 5
    Last Post: 05-07-2014, 09:25 AM
  5. Replies: 2
    Last Post: 02-04-2010, 10:45 AM

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