Results 1 to 7 of 7
  1. #1
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,191

    Adding Signature After HTML Table

    Hi Guy's I am struggling to find where i am going wrong here, my signature adds to the HTML Table instead of after



    in strHTML body I have closed off the table </tr> and in the email, i am trying to add signature after table but signature goes into table, i must have something wrong ?

    I thought the bold </tr> would end the table

    i thought the x 2 bold <br> and strSign would be outside of the table but goes into last row of table !!!!

    Gotta have something wrong that i have mis understood ?

    Would appreciate a nudge to what i can't understand ?


    Code:
    SigFile = "DMT dispatch@ Email Signature.jpg"
    strSign = "Kindest Regards" & "<br>" & "<br>" & _    "<P><IMG border=0 hspace=0 alt='' src='file://T:/DMT Ltd/Logo Media/" & SigFile & "' align=baseline></P>" & "<br>" & "<br>" & _
        "<FONT color=#00008B>" & eDisc & "<br>" & "<FONT color =#00008B>" & eDisc2
    'SET THE TABLE AND HEADERS
        strHTML = "<HTML><Body><table border='3' width=auto'><font color='blue' size='3' face='Times New Roman'><tr><th>Del To</th><th>Town</th><th>PostCode</th>" & _
            "<th>Lift Type</th></th><th>MFG</th><th>SL</th><th>Qty</th><th>Arrived-Added</th><th>Date Due</th><th>Date Now</th><th>Days Remaining</font><th></tr>"
    'LINK BODY WITH TABLE
            strBody = strHTML
    'SET RS CRITERIA
            strType = "Item"
    'SET THE RECORDS
            
        strSQL = "SELECT tblStorage.ID, tblStorage.DelTo, tblStorage.Town, tblStorage.PostCode, tblStorage.MFG, tblStorage.SL, tblStorage.LiftType, tblStorage.Qty, tblStorage.DateAdded, tblStorage.DateDue " _
                & "From tblStorage " _
                & "ORDER BY tblStorage.DateDue;"
    
    
        Set rs = CurrentDb.OpenRecordset(strSQL)
    
    
        Do While Not rs.EOF
    
    
    dtNow = Date
            
            intDays = DateDiff("d", dtNow, rs.Fields("DateDue"))
          
            Select Case intDays
            
                Case Is > 7
                
                strDays = "<font color='blue' size='4' face='Times New Roman'>" & DateDiff("d", dtNow, rs.Fields("DateDue")) & "</font>"
                
                Case Else
                
                strDays = "<font color='red' size='4' face='Times New Roman'><B>" & DateDiff("d", dtNow, rs.Fields("DateDue")) & "</font></B>"
                
            End Select
    
    
    strFS = "<font size='3' face='Times New Roman' style='text-align='center'>"
    strFE = "</font>"
    
    
        strBody = strBody & "<tr><td>" & strFS & rs.Fields("DelTo") & strFE & "</td><td>" & strFS & rs.Fields("Town") & strFE & "</td><td>" & strFS & rs.Fields("PostCode") & strFE & "</td><td>" & _
        strFS & rs.Fields("LiftType") & strFE & "</td><td>" & strFS & rs.Fields("MFG") & strFE & "</td><td>" & strFS & rs.Fields("SL") & strFE & "</td><td>" & strFS & rs.Fields("Qty") & strFE & "</td><td>" & strFS & _
        Format(rs.Fields("DateAdded"), "ddd-dd-mmm-yyyy") & strFE & "</td><td>" & strFS & Format(rs.Fields("DateDue"), "ddd-dd-mmm-yyyy") & strFE & "</td><td>" & _
        strFS & Format(dtNow, "ddd-dd-mmm-yyyy") & "</td><td>" & strFE & strFS & strDays & strFE & "</td></tr>" & "|"
       
       rs.MoveNext
       Loop
        
       strBody2 = strBody2
    
    
        str7Day = "<font color='red' size='4' face='Times New Roman'>" & "Red" & "</font>"
        
        strWarn = "Once The Days Remaining Field Is 7 Days Or Less, This Will Change To " & str7Day & _
        " To Confirm There Is Only 7 Days Left For Delivery/Collection"
    
    
        Set olItem = olApp.CreateItem(olMailItem)
        Set olAccount = olApp.Session.Accounts.Item(1)
        With olItem
        .Attachments.Add aPath & aFile
        .To = "me@home.com"
        .subject = "DMT Live Updates" & "-" & Format(Me.txtUpdate, "ddd-dd-mmm-yyyy")
        .HTMLBody = strFS & TOD & " Please find DMT Live Updates Attached" & "<br>" & "<br>" & _
        "DMT Storage Data Listed: " & Format(Me.txtUpdate, "ddd-dd-mmm-yyyy") & "<br>" & "<br>" & _
        strWarn & "<br>" & "<br>" & _
        "Storage Data:" & "<br>" & Replace(strBody, "|", "<br>") & "<br>" & "<br>" & _
        strSign
        .ReadReceiptRequested = True
        .SendUsingAccount = olAccount
        .Display
        End With
    Last edited by DMT Dave; 12-03-2022 at 09:17 AM.

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,800
    I thought the bold </tr> would end the table
    Save yourself some time waiting for responses here and research html tags (and similar things that stump you). You would have discovered hours ago that tr is for table row, not table.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,191
    Hi Micron, ahh ok, yes i found a site with all html listing but only ever been on to find what i was looking for at the time

    Yes tr os row and th is header and if i have a look, i will need to find out closing the table tag

  4. #4
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,800
    https://www.w3schools.com/tags/tag_table.asp

    EDIT - you also have an unterminated th in your table html. I suggest you use Notepad++ for generating html. BTW, I can't recall if your use of single quotes for tag attributes is going to be a problem or not.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,191
    Thank you micron, i wil go through what you have spotted and i think that is the i have in favourites but will check it out, much appreciated

  6. #6
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,800
    I put some of what you have in NotePad++ and it looks like this when indented (ignore the concatenation I removed; that was just for shortening the lines).
    Code:
    <HTML>
       <Body>
          <table border='3' width=auto'>
             <font color='blue' size='3' face='Times New Roman'>
                <tr>
                   <th>Del To</th>
                   <th>Town</th>
                   <th>PostCode</th>
                   <th>Lift Type</th>
                                </th>
                   <th>MFG</th>
                   <th>SL</th>
                   <th>Qty</th>
                   <th>Arrived-Added</th>
                   <th>Date Due</th>
                   <th>Date Now</th>
                   <th>Days Remaining
              </font>
                   <th>
               </tr>
               <tr>
                   <td>strFS & rs.Fields("DelTo") & strFE</td>
                   <td>strFS & rs.Fields("Town") & strFE</td>
                   <td>strFS & rs.Fields("PostCode") & strFE</td>
                   <td>strFS & rs.Fields("LiftType") & strFE</td>
                   <td>strFS & rs.Fields("MFG") & strFE</td>
                   <td>strFS & rs.Fields("SL") & strFE</td>
                   <td>strFS & rs.Fields("Qty") & strFE</td>
                   <td>strFS & Format(rs.Fields("DateAdded"), "ddd-dd-mmm-yyyy") & strFE</td>
                   <td>strFS & Format(rs.Fields("DateDue"), "ddd-dd-mmm-yyyy") & strFE</td>
                   <td>strFS & Format(dtNow, "ddd-dd-mmm-yyyy")</td>
                   <td>strFE & strFS & strDays & strFE</td>
               </tr>" & "|"
    If that is all of your html (I couldn't see where the missing parts at the end are in your code) you should be able to spot missing tags and tags out of sequence. Maybe the html4 syntax you're using will work in an email, but 4 is deprecated in favour of what many refer to as html5 with CSS.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  7. #7
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,191
    Micron, thank you i am going to compare, see where i have gone wrong with mine as you suggested an unterminated table header

    Will also have a look at the link you sent, thank you for suggestions

    greatly appreciated

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Adding a Digital Signature field
    By Thompyt in forum Forms
    Replies: 7
    Last Post: 08-02-2022, 06:48 PM
  2. Adding Excel Cells To Email html body
    By DMT Dave in forum Access
    Replies: 15
    Last Post: 04-24-2022, 11:52 AM
  3. Adding Items To HTML Email Body
    By DMT Dave in forum Access
    Replies: 6
    Last Post: 01-03-2022, 04:15 AM
  4. Replies: 7
    Last Post: 11-27-2013, 08:37 AM
  5. adding signature to the email sendobject
    By webisti in forum Access
    Replies: 3
    Last Post: 07-10-2012, 03:08 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