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

    Adding Items To HTML Email Body


    Hi Guy's and a happy new year to you all

    I have been looking to HTML email body, I already use html quite a lot, I have found a site which is quite useful https://www.w3schools.com/html/html_examples.asp

    I am trying to integrate into my existing html code for example a date picker, whilst I have the code taken from the html examples site, i am unsure if i need quotes or characters to add into my code ?

    taken from examples

    Code:
    <!DOCTYPE html><html>
    <body>
    
    
    <h1>Display a Week Input Control</h1>
    
    
    <p>The <strong>input type="week"</strong> allows the user to select a week and year.</p>
    
    
    <p>If the browser supports it, a date picker pops up when entering the input field.</p>
    
    
    <form action="/action_page.php">
      <label for="week">Select a week:</label>
      <input type="week" id="week" name="week">
      <input type="submit" value="Submit">
    </form>
    
    
    <p><strong>Note:</strong> type="week" is not supported in Firefox, Safari or Internet Explorer 11.</p>
    
    
    </body>
    </html>
    Result of examples
    Display a Week Input Control

    The input type="week" allows the user to select a week and year.
    If the browser supports it, a date picker pops up when entering the input field.
    Select a week: Note: type="week" is not supported in Firefox, Safari or Internet Explorer 11.

    My code, I have tried to add in the html between c and d string

    Code:
    Dim a as string, b as string etc....
    a = myGreet
    b = "Thank you for looking at this email"
    c = "You can select a different week than what we currently have allocated for you."
    .HTMLBody = a & "<br>" & "<br>" & b & "<br>" & "<br>" & c & "<br>" & "<br> " & _
      <label for="week">Select a week:</label> TRIED ADDING THIS LINE AND ADDING QUOTES AND a "<br>" new line
      <input type="week" id="week" name="week"> TRIED ADDING THIS LINE AND ADDING QUOTES AND a "<br>" new line
      <input type="submit" value="Submit"> TRIED ADDING THIS LINE AND ADDING QUOTES AND a "<br>" new line
    d & "<br>" & e & "<br>" & "<br>" & f & "<br>" & "<br>" & g & "<br>" & "<br>" & h & "<br>" & "<br>" & _
    d & "<br>" & "<br>" & "<B/>" & i2 & "<B/>" & "<a href=" & Q & SafetyMsg & Q & "> https://www.website removed on here/client-safety </a>" & "<br>" & "<br>" & _
    d & "<br>" & "<B/>" & j & "<B/>" & "<br>" & "<br>" & "<B/>" & k & "<B/>" & "<a href=" & Q & BookingLink & Q & "> https://www.website removed on here/client-bookings </a>" & " Reference " & " " & RecNo & "<br>" & "<br>" & _
    "<B/>" & l & "<B/>" & "<a href=" & Q & reBook & Q & "> https://www.website removed on here.com/re-book </a>" & "<br>" & "<br>" & _
    r & "<br>" & "<br>" & _
    s & "<br>" & "<br>" & _
    "<P><IMG border=0 hspace=0 alt='' src='file://T:/" & SigFile & "' align=baseline></P>" & "<br>" & "<br>" & _
    "<FONT color=#0000CD>" & eDisc & "<br>" & "<FONT color =#0000CD>" & eDisc2
    .SendUsingAccount = OutAccount
    Thank you for any advice

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    You are building an email, not a web page, so how is a date picker relevant?
    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
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,185
    Thanks June7, ahh ok thank you, the date picker was just an example but i think by the sounds of it, the website I found with examples is purely for web pages ?

    I will abort, just looking into learning more about html code and if any useful samples I come across i may be able to learn and use

  4. #4
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Your example is primarily for a browser supported form which may or may not be on a web page. As long as that control can be handled by a web browser you can work with it. So if you download a form and open it in your browser and your browser supports the control, it will operate as intended. In that case, you are not dealing with a web page. If you fill out that form on line, then you are. I don't know if any Office product will support such a control (I'm not including any M$ browser app as an Office product as IMO a M$ compatible browser would be a Windows based app, not Office based).

    See W3 schools website for html and related information. Pure html is a bit of a dinosaur, so while it might be fun to learn I suspect you'll find limited use for it. HTML5, CSS and XML is more up to date if you intend to go down the path of browser supported presentation.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    Can use HTML code tags to format text in email body. This is a common topic. As for including interactive features such a date picker or drop list, really doesn't seem relevant for 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.

  6. #6
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Quote Originally Posted by June7 View Post
    Can use HTML code tags to format text in email body.
    Hence I wrote
    you'll find limited use for it
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  7. #7
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,859
    I was helping someone quite recently on another site with a html email.
    This might give you more of a clue?

    This is purely for, a formatted pretty email, no interaction at all.

    https://www.access-programmers.co.uk...ueries.320989/
    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

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

Similar Threads

  1. Adding a linked reply to email body
    By DMT Dave in forum Access
    Replies: 3
    Last Post: 09-16-2021, 12:39 PM
  2. Replies: 1
    Last Post: 06-19-2018, 10:38 AM
  3. email body using html format
    By baronqueefington in forum Programming
    Replies: 5
    Last Post: 02-03-2015, 03:44 PM
  4. Sending Reports with email body having HTML
    By CeVaEs_64 in forum Access
    Replies: 28
    Last Post: 11-26-2014, 12:13 PM
  5. Export html to body of email issue
    By mmart33 in forum Reports
    Replies: 3
    Last Post: 02-28-2013, 03:16 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