+ Reply to Thread
Results 1 to 10 of 10

Getting html code instead of output in mail body

  1. #1
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Getting html code instead of output in mail body

    Hi friends,

    I want to have a mail body combination of ‘html and word document’. Now the code is creating a mail body of ‘html’ code and a matter in word document. I want the output of ‘html’ code in the mail body instead of ‘html’ code.

    Please see the attached workbook and suggest me the amendment.

    Any help will be highly appreciated.

    Thanking you in anticipation.
    Attached Files Attached Files
    Sincerely,

    mso3

  2. #2
    Valued Forum Contributor
    Join Date
    05-14-2012
    Location
    Unknown
    MS-Off Ver
    Unseen
    Posts
    429

    Re: Getting html code instead of output in mail body

    You would need something like this:

    Please Login or Register  to view this content.
    Can't test it properly as I don't have all the relevant documents

    Note had to put spaces around the less than and greater than signs

  3. #3
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: Getting html code instead of output in mail body

    Hi,

    Thank you. I inserted the code in my workbook but I’m getting run-time error 438 object doesn’t support this property or method on the following line

    Please Login or Register  to view this content.
    The code is:
    For testing you may create a folder and a word file as the path given in the code for word file.

    Please Login or Register  to view this content.
    Thanking you,

  4. #4
    Valued Forum Contributor
    Join Date
    05-14-2012
    Location
    Unknown
    MS-Off Ver
    Unseen
    Posts
    429

    Re: Getting html code instead of output in mail body

    Probably should just be this; I changed stuff to get it to compile ...

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: Getting html code instead of output in mail body

    Hi,

    Thank you. The error has gone but now I’m getting a code with text output in mail body without formatting as in main word document. I’m attaching a main birthday3 document a birthday3 mail output for your reference.

    Thanking you,

    Have a nice time.
    Attached Files Attached Files

  6. #6
    Valued Forum Contributor
    Join Date
    05-14-2012
    Location
    Unknown
    MS-Off Ver
    Unseen
    Posts
    429

    Re: Getting html code instead of output in mail body

    This works but I suspect it does not do quite what you want it to. I think, if you want to insert the content of a Word file, you will need to include HTML text in that too. But then it all becomes a little pointless; you might as well just create a Text file with all the HTML text in it.
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: Getting html code instead of output in mail body

    Hello,

    Thank you. It works fine if I write a message in html but I want to create a program for the users who don’t know programming languages. The user should simply type a message in plane text with word formatting in word document. It’s an easy and simple way for him.

    I have an idea/approach to achieve the target as per my requirement.
    I have a mail merge programme to create a separate letter for each person.
    The file name is same as in excel workbook in column ‘N’.
    If you could suggest me a code to match the name and the name of word file store in ‘output’ folder which is in the folder ‘contact directory’.
    Automatically match and open the word file in ‘output’ folder--copy it--paste it in mail body.

    The following code works fine. Only I require an amendment in it to match the word file from ‘output’ folder which is in ‘contact directory’ folder.

    Please Login or Register  to view this content.
    Please don’t mind. Sorry for trouble. We are not achieving the requirement by our first approach so I’m suggesting this second approach to achieve the target as per requirement.

    Thanking you,

  8. #8
    Valued Forum Contributor
    Join Date
    05-14-2012
    Location
    Unknown
    MS-Off Ver
    Unseen
    Posts
    429

    Re: Getting html code instead of output in mail body

    I think we probably need to draw a line under this thread now. I don't think I can help any more.

    My suggestion would be that you read the Word document into memory and then use Replace to convert the new line characters, etc., to HTML equivalents. That said, I'm not sure if the picture would translate.

    However, I'm all out of steam here.

    In the light of what you have discovered so far, it might be worth starting a new thread.

  9. #9
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: Getting html code instead of output in mail body

    Hello,

    Greetings from me!

    Thanks for your kind guidance. I learned a new skill from you. First of all I will work on a new approach and then if there is a problem then post a new thread for your guidance.

    Have a nice day.

  10. #10
    Valued Forum Contributor
    Join Date
    05-14-2012
    Location
    Unknown
    MS-Off Ver
    Unseen
    Posts
    429

    Re: Getting html code instead of output in mail body

    You're welcome. Thanks for the rep.

+ 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 for copying body of the mail from outlook
    By aravindkm in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-08-2015, 03:37 AM
  2. Using HTML Body Format in Outlook mail
    By akash kothari in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-08-2014, 11:33 AM
  3. VBA code to export body of the mail
    By aravindkm in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-15-2014, 07:37 AM
  4. VBA code to export the body of the mail - help please
    By aravindkm in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-15-2014, 12:03 AM
  5. Code to insert stationary in mail body
    By mukeshbaviskar in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-05-2013, 11:39 AM
  6. Send e-mail with image on body (.html) on e-mail manager <> outlook
    By mariotnc in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-05-2012, 09:28 PM
  7. VBA code does not pastes data in the Mail Body
    By MacroMan82 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-11-2010, 11:19 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