PDA

View Full Version : Still a challenge



joelle
09-21-2007, 11:08 AM
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.
Sub attachWB ()
Dim x As Boolean
ThisWorkbook.Sheets.Copy
x = Application.Dialogs(xlDialogSendMail).Show
End Sub


joelle

JKwan
09-21-2007, 11:21 AM
Try this:

Application.Dialogs(xlDialogSendMail).Show "xx@xx.com"

joelle
09-21-2007, 12:04 PM
Hi Jkwan,

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

joelle

JKwan
09-21-2007, 12:05 PM
did you remove the "x="?

joelle
09-21-2007, 12:08 PM
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

qff
09-21-2007, 02:06 PM
As JKwan said all you need is to add the name


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


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

regards
qff

joelle
09-21-2007, 03:15 PM
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.

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

joelle

qff
09-21-2007, 03:55 PM
Hi Joelle

this code works fine for me.

What mail app do you use?

regards
qff

joelle
09-21-2007, 03:59 PM
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