Results 1 to 4 of 4
  1. #1
    dshillington is offline Novice
    Windows XP Access 2003
    Join Date
    Dec 2011
    Posts
    7

    HTML issue when using Word as email editor

    I have created a DB that resides on a shared network drive and used by multiple people in the organization (not at the same time). This DB has a main form that users input data from dropdown lists and free text. Once all the data is entered, a submit button is pressed and it formats an email in an HTML format that gets sent out. Works as designed except........



    The problem I'm having is that some of the users have Outlook 2003 set to use Word as their email editor, and some don't. For the users who don't use the above setting, the email formats and displays perfectly. For the users who use the above setting, the body of the email is blank.

    In the spirit of respecting people's personal preferences with regards to their settings, I am seeking some VBA advice on how to program (if possible) for this email to display in HTML regardless of what setting they use. I know it's not possible to call a macro to toggle this setting on/off at will, thus leaving me relatively helpless right now.......

    I have searched endlessly for an answer and can't seem to come up with anything that I understand. I am a relative newby to VBA (I can make sense of other's code, but probably couldn't write from scratch), so please be gentle.

    Dave

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Show the code the processes the email. Does the email need to open for review before it is sent?
    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
    dshillington is offline Novice
    Windows XP Access 2003
    Join Date
    Dec 2011
    Posts
    7
    Private Sub Command202_Click()
    'Creates a new e-mail item and modifies its properties.
    Dim objEmail As Outlook.MailItem
    Dim objOutlook As Outlook.Application
    ReportType = Me!cboActionTaken
    IRIB = Me!Text87
    Incident = Me!Text163
    Region = Me!cboRegion
    City = Me!cboCity
    Problem = Me!cboInCa
    Date = Me!cboDate
    Update = Me!cmbUpNo
    'Create e-mail item
    Set objOutlook = CreateObject("Outlook.application")
    Set objEmail = objOutlook.CreateItem(olMailItem)
    Dim TestHTMLString As String

    With objEmail
    .SentOnBehalfOfName = "Email Account"
    .Importance = olImportanceHigh
    .To = "Distribution List"
    .Subject = "Pre-populated from information on Access Form"
    If (Me.chkUpdate) = True Then
    .Subject = .Subject & " " & cmbUpNo
    .HTMLBody = .HTMLBody & "<body><font face=Arial color=black>"
    .HTMLBody = .HTMLBody & Replace(txtUpdate, vbCrLf, "<br>") & "<br>" & "<br>"
    End If
    'Set body format to HTML
    .BodyFormat = olFormatHTML
    .HTMLBody = .HTMLBody & "<body><font face=Arial color=black>"
    .HTMLBody = .HTMLBody & "<b>" & Event_Notes_Label & "</b>" & <br>"
    .HTMLBody = .HTMLBody & cboIncident & "<br>" & "<br>"
    .HTMLBody = .HTMLBody & "<b>STATUS:</b> " & "<br>" & cboStatus & "<br>" & "<br>"
    .HTMLBody = .HTMLBody & "<b>DURATION:</b> " & "<br>" & cboDuration & "<br>" & "<br>"
    .HTMLBody = .HTMLBody & "<b>ACTION:</b> " & "<br>" & cboActions & "<br>" & "<br>"
    .HTMLBody = .HTMLBody & "<b>MEDIA:</b> " & "<br>" & cboMedia & "<br>" & "<br>"
    .HTMLBody = .HTMLBody & "<b>POLICE, FIRE, AMBULANCE CONTACTED:</b> " & "<br>" & ES_Contacted & "<br>" & "<br>"
    .HTMLBody = .HTMLBody & "<b>MAG STAFF:</b> " & "<br>" & cboMAGStaff & "<br>" & "<br>"
    .HTMLBody = .HTMLBody & "<b>CO-LOCATED MINISTRY STAFF:</b> " & "<br>" & cboCOLo & "<br>" & "<br>"
    .HTMLBody = .HTMLBody & "<b>OTHER MEMC's NOTIFIED:</b> " & "<br>" & Text187 & "<br>" & "<br>"
    .HTMLBody = .HTMLBody & "<b>ON DUTY:</b> " & "<br>" & cboDO & "<br>" & cboDOAd & "<br>" & "Telephone: " & cboDOTel & "<br>" & "BlackBerry: " & cboDOBB & "<br>" & cboDOEm & "<br>" & "<br>"
    .HTMLBody = .HTMLBody & "</font></color></body>"
    .Display
    End With
    End Sub

    I do need the end user to view the email before sending.

    Any help would be appreciated.

    Thanks

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    I no longer have Access 2003 available. This article says Access 2007 and 2010 always use Word for editing http://email.about.com/od/outlooktip...in_Outlook.htm

    Setting an alternate editor does not seem to be an option in 2007 and 2010.

    I have an automated email procedure using code similar to yours but using 2007 and have no issues with the procedure.

    Sorry, I don't have a resolution for the issue with 2003.
    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. Access to Word - Multiple Word Templates?
    By alpinegroove in forum Programming
    Replies: 11
    Last Post: 06-12-2012, 04:42 PM
  2. Replies: 1
    Last Post: 01-24-2012, 08:31 PM
  3. Replies: 1
    Last Post: 03-18-2011, 03:22 PM
  4. HTML Editor
    By mystifier in forum Forms
    Replies: 3
    Last Post: 11-11-2010, 05:51 AM
  5. Text editor
    By smiles_chicago in forum Forms
    Replies: 0
    Last Post: 10-21-2008, 12:38 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