Results 1 to 4 of 4
  1. #1
    mari_hitz is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    28

    HTML Mail sent from access

    Hi everybody!

    Hope you are great! I am trying to find assistance as this is urgent but no pressure haha. I have a database that sends e-mails from access trough Outlook. I need the e-mail to be send to contain HTML type and what I could do is to copy the wording that I have into a table in a field with rich text and then create a form and reference the code that I have to send the e-mail to paste the verbiage from an specific field of that form. Anyways, some of the hyperlinks are not working and I really need the verbiage to be sent in Calibri.
    The code works just fine and it sends the e-mail correctly, however the font in which is sent is Times New Roman instead of Calibri. Its weird because some parts of the texts are sent in calibri and others not. I have set the fields of both table and forms to be calibri. Do you have any idea how can I make the links work and how can I make to send the e-mail with calibri? I rally do not have any idea how to send the e-mail lilke HTML, I have tried to create a template in outlook but I can not make it work, the only way that I could find was this. I would really appreciate your help in this matter, I have asked in another Forum of access but no one could help me.



    here is my code, thanks in advance:

    Code:
    Private Sub Command43_Click()
    Dim MyDB As Database
      Dim MyRS As Recordset
      Dim MyForm As Form
      Dim objOutlook As Outlook.Application
      Dim objOutlookMsg As Outlook.MailItem
      Dim objOutlookRecip As Outlook.Recipient
      Dim objOutlookAttach As Outlook.Attachment
      Dim TheAddress As String
      Dim TheBody As String
      
       
      Set MyDB = CurrentDb
      Set MyRS = MyDB.OpenRecordset("Sheet2")
      MyRS.MoveFirst
      Set MyForm = Forms(Memo)
      
      ' Create the Outlook session.
      Set objOutlook = CreateObject("Outlook.Application")
      
      Do Until MyRS.EOF
      ' Create the e-mail message.
      Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
      TheAddress = MyRS![Enterprise]
      TheBody = Forms!Memo!Field1
      
    
         With objOutlookMsg
            ' Add the To recipients to the e-mail message.
            Set objOutlookRecip = .Recipients.Add(TheAddress)
            objOutlookRecip.Type = olBCC
    
            
            ' Set the Subject, the Body, and the Importance of the e-mail message.
            .To = MyRS![Enterprise]
            .Subject = "ACTION REQUIRED: Confirm Your Assignment Start Date"
            .HTMLBody = TheBody
            .Importance = olImportanceHigh  'High importance
            
            
             
            
         
            ' Resolve the name of each Recipient.
            For Each objOutlookRecip In .Recipients
               objOutlookRecip.Resolve
               If Not objOutlookRecip.Resolve Then
                 objOutlookMsg.Display
               End If
            Next
            .Send
          End With
          MyRS.MoveNext
       Loop
       Set objOutlookMsg = Nothing
       Set objOutlook = Nothing
    End Sub

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    Google: HTML Calibri font

    Revew http://en.wikipedia.org/wiki/Font_family_(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
    mari_hitz is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    28
    Quote Originally Posted by June7 View Post
    Google: HTML Calibri font

    Revew http://en.wikipedia.org/wiki/Font_family_(HTML)

    Thanks June7 for your post, I do not know what you were trying to point out since the link you posted is not working and if I put "Font Family (HTML)" in wikipedia does not answer my questions or have any useful information.

    I am not trying to be rude here, but I have tried to search this info on my own, and given my lack of knowledge in both Access VBA and HTML I could not understand or try to figure out how to solve my isse.

    I would appreciate if someone could be so kind to help me on this, I wouldn't be here if didn't need help on the issue. Thanks in advanced for all the support. I am really sad because everytime I had an issue, either here or in another Forum: Access UK forum, people was always so helpful and kind towards me and I know sometimes people who does not understand something can be a little pain in the bottom.
    I wish I could have all the knowledge you guys have, but I am learning hard and trying to get at your level, hope to get there some day and help others just like you do.

    Thanks and regards,

    Mari

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    Sorry, is odd, that is the url in the browser.

    It works if I copy/paste the url string into browser.

    Some reason the final ) doesn't paste properly in the link in post but I managed to fix it in previous post.

    The article shows using various HTML tags to specify a font style. A list in the article shows Calibri.

    I have a very simple procedure to send email with attachment but I don't do any HTML text in the body. I have done limited testing of HTML coded text in email body. Post an example of your body text for analysis.
    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.

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

Similar Threads

  1. HTML body in Access 2007
    By amangupts in forum Forms
    Replies: 4
    Last Post: 12-19-2011, 05:52 AM
  2. Replies: 0
    Last Post: 05-23-2010, 10:39 PM
  3. Access 2003 - Export Report to HTML
    By darth.pathos in forum Import/Export Data
    Replies: 0
    Last Post: 03-20-2010, 01:13 PM
  4. Import HTML files into access
    By mccrimmon in forum Programming
    Replies: 0
    Last Post: 02-15-2010, 03:40 PM
  5. HTML E-mail Using VBA
    By graviz in forum Programming
    Replies: 1
    Last Post: 12-09-2009, 08:52 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