With Outmail - Conditional Email String for .HTMLBody tag

  • Good morning all,

    I am currently using the With Outmail statement and the .HTMLbody tag to compose an HTML-formatted email. It works fine, however, since it is HTML, the end user is going to get a long email with much of it not needed. Here is the current code:

    What I am attempting to do is to use an If Else Statement combined with a String to use the field "cmbEscalation_Type" to determine which String the .HTMLBody tag should use. This way, I can make a different .HTMLbody formatted email for each of the choices in the cmbEscalation_Type combobox. I started off with the first line and I'm getting a "Compile error: Object Required" Error. It's pointing to the last value in the string, "EscalationsForm.tbRescDescription" I haven't even dealt with the change in conditions yet, but here is the code that generates that error:

    Any help with the first part or even the conditional portion is greatly appreciated by this VBA Novice + (Still a novice, but gaining experience, lol). Thanks!

  • Re: With Outmail - Conditional Email String for .HTMLBody tag

    Is possibly the SET statement - this is only used to assign Objects to a variable. A String is not an Object, but a simple string.

    Untested, unchecked - I now have a headache from reading that and scrolling left and right like a lunatic (Not your fault - it's the way the board parses code... On second thoughts it IS your fault. Use Line continuations. It'll help you too) :)

  • Re: With Outmail - Conditional Email String for .HTMLBody tag

    OMG...I'm so sorry to have wasted your time (and to have given you a headache) for such a simple problem! Wow.

    Thanks for helping but now I'm embarrassed it was such an easy issue. lol

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!