Consulting

Results 1 to 9 of 9

Thread: Still a challenge

  1. #1
    VBAX Tutor joelle's Avatar
    Joined
    Apr 2005
    Location
    Sunnyvale, CA
    Posts
    204
    Location

    Still a challenge

    Dear Experts,
    Been a while since I last posted (well this means very little that I've gotten sharper )

    Anyway, I have this email challenge but it is simple in nature.
    Pls note I do *not* want the code to send email, or save the workbook, or close the wb for me.
    So far the code works great:
    1. It attaches the wb to an email popup window
    2. I need this --> Fill in the recipient's name (abc@abc.com)
    Then stop right here. No code for subject needed.

    Is this achievable? Many thanks and pls see code below. Also, what is nice about this code is so far it works with both Outlook and Netscape.

    Lastly, I beg you one thing : pls do not ask me to go to ronbruin.com or refer me to any other link. I have been through many many long lenghthy codes that do not help solve no. 2 above.
    [VBA]Sub attachWB ()
    Dim x As Boolean
    ThisWorkbook.Sheets.Copy
    x = Application.Dialogs(xlDialogSendMail).Show
    End Sub
    [/VBA]

    joelle

  2. #2
    VBAX Expert
    Joined
    Aug 2004
    Posts
    810
    Location
    Try this:
    [VBA]
    Application.Dialogs(xlDialogSendMail).Show "xx@xx.com"
    [/VBA]

  3. #3
    VBAX Tutor joelle's Avatar
    Joined
    Apr 2005
    Location
    Sunnyvale, CA
    Posts
    204
    Location
    Hi Jkwan,

    Nope - does not work. It shows Compile error, syntax error.

    joelle

  4. #4
    VBAX Expert
    Joined
    Aug 2004
    Posts
    810
    Location
    did you remove the "x="?

  5. #5
    VBAX Tutor joelle's Avatar
    Joined
    Apr 2005
    Location
    Sunnyvale, CA
    Posts
    204
    Location
    Now I did. No more error warning but it does not show the recipients name.
    It just does what I tried with different methods before -- attaching the wb to the pop window thats all.

    And I dont believe that this is not achievable - It is just a recipient name and I just dont know what piece of code is missing here ???

    joelle
    Last edited by joelle; 09-21-2007 at 01:29 PM.

  6. #6
    As JKwan said all you need is to add the name

    [vba]
    sub mymailer()
    ThisWorkbook.Sheets.Copy
    Application.Dialogs(xlDialogSendMail).Show "myname.com"
    End sub[/vba]


    Ps.make sure you don't already have a mail window open

    regards
    qff

  7. #7
    VBAX Tutor joelle's Avatar
    Joined
    Apr 2005
    Location
    Sunnyvale, CA
    Posts
    204
    Location
    Hello qff,

    Yes, I did, as mentioned earlier and shown in the code below, the code does *attach* the wb to my email window but the recipient "myname@mn.com" or "whatever@abc.com" just refuses to show up. Btw, I use Netscape 7.2.

    [vba]Sub email()
    ThisWorkbook.Sheets.Copy
    Application.Dialogs(xlDialogSendMail).Show "whatever@abc.com"
    End Sub[/vba]
    Any other hints are greatly appreciated.

    joelle

  8. #8
    Hi Joelle

    this code works fine for me.

    What mail app do you use?

    regards
    qff

  9. #9
    VBAX Tutor joelle's Avatar
    Joined
    Apr 2005
    Location
    Sunnyvale, CA
    Posts
    204
    Location
    Hi qff,

    I used Netscape 7.2 and the code works for me too, except for the recipient name to show on the "To:" line from the email window, which is my main roadblock right now. Thanks for your effort to help.

    joelle

Posting Permissions

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