+ Reply to Thread
Results 1 to 6 of 6

VBA code to send Outlook email with HTML text no longer working

  1. #1
    Registered User
    Join Date
    09-07-2013
    Location
    Chester
    MS-Off Ver
    Home: 2011 for Mac Work: 2007
    Posts
    70

    VBA code to send Outlook email with HTML text no longer working

    Hello all

    I have a User Form which when ran should generate and display an Outlook email with a distribution list and the contents of the form in to the body of the mail. It was built on an XP machine running Office 2003 and worked perfectly, we're now on Win 7 at work running 2010 and it no longer works as it should.

    When run in Excel 2010 and Outlook 2010, the email opens, populates all names in the email distribution list and adds the email subject, however the body of the mail is blank. I'm afraid my VBA knowledge is fairly limited so I'm not able to work out why it no longer works, I'd very much appreciate your thoughts on the below or if you know of any other reason why it would stop working in 2010

    Many thanks in advance for any advice

    Twaddy

    Please Login or Register  to view this content.
    The code then details the HTML code after 'HTMLbody =' for the email contents section, essentially it sets the font, specifies some text as bold, adds lines breaks etc and pulls in information from certain fields on the user form to create the body of the mail. Unfortunately the forum won't let me past the firewall to post it with the full HTML code, code even when I try and wrap it with HTML tags, I must be doing something wrong. If anyone can advise how I can update the post with the full code I'd appreciate it

    The code then continues and completes with...

    Please Login or Register  to view this content.
    The code itself worked perfectly on Excel 2003 so I don't believe it's that, it doesn't Debug when ran either, it just creates the email with the body of the mail blank

    Any thoughts would be very welcome

    Twaddy

  2. #2
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: VBA code to send Outlook email with HTML text no longer working

    I'm not sure this will work, but I thought I'd post it just in case.
    Take the details after the HTMLbody = and paste it into a function and name the function
    Please Login or Register  to view this content.
    Then change your
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    As said, not sure if this will work, but it is how I have mine set up.
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

  3. #3
    Registered User
    Join Date
    09-07-2013
    Location
    Chester
    MS-Off Ver
    Home: 2011 for Mac Work: 2007
    Posts
    70

    Re: VBA code to send Outlook email with HTML text no longer working

    Hi gmr4evr1

    Thanks for your reply, unfortunately it didn't work for me, the email opens ok but still nothing appears in the body of the email

    I'm starting to wonder whether my work has placed restrictions on Outlook or something that's preventing the HTML text being formatted

    Thanks anyway for your reply

    Twaddy

  4. #4
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: VBA code to send Outlook email with HTML text no longer working

    Can you post the code you have with the changes I suggested? that way I can test it and see if it works for me or not. If it does, then you might be right about work restricting it. If it doesn't, then I can try to make changes to the code to get it working correctly.

  5. #5
    Registered User
    Join Date
    09-07-2013
    Location
    Chester
    MS-Off Ver
    Home: 2011 for Mac Work: 2007
    Posts
    70

    Re: VBA code to send Outlook email with HTML text no longer working

    Hi gmr4evr1

    Apologies for the delayed reply

    I've discovered that the code works perfectly when using my work laptop at home through my wifi connection, however not when in the office when connected via a network cable, so I can only presume it's linked to security settings in the office.

    It doesn't really make sense as I'm required to connect to the company network securely when at home also

    Thanks anyway for your replies and offer of help

    Twaddy

  6. #6
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: VBA code to send Outlook email with HTML text no longer working

    Sorry we couldn't get it resolved for you. I agree, it is odd that it works from home on the company network, but not when actually at work.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. VBA code to make Excel send an email via Outlook
    By vanni in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-27-2015, 06:26 AM
  2. [SOLVED] Send email from excel 2007 and Outlook 2003 not working
    By Megatronixs in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 09-29-2014, 01:57 AM
  3. Macro to send saved draft email from outlook in HTML format
    By jamesshakedown in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-18-2013, 07:55 AM
  4. Marco to send email via MAC (Outlook is working fine)
    By angela1979 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-28-2013, 07:10 PM
  5. code to send an email from outlook on last working day of a month
    By Shanthuday in forum Outlook Programming / VBA / Macros
    Replies: 1
    Last Post: 07-10-2013, 11:23 AM
  6. [SOLVED] VBA code - automatically open outlook to send email
    By LindaABH in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-06-2012, 01:44 AM
  7. Email Out of Excel Code no longer working due to update or drive change.
    By Kidcarlosuk in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-12-2012, 06:37 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1