Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending E-mail

Status
Not open for further replies.

thatjayguy

Technical User
Jan 27, 2003
4
CA
I am creating a userform and would like to include a "Mail to author" link. All I want it to do is open up a new message and allow the user to enter the e-mail "body" to explain any difficulties that they are having.

In "standard" VB there is a feature where you simply write
mailto:recipient. Is there nothing similar in Excel 97? I have looked at the sendmail procedure but it doesn't seem to allow for any "body" text to be entered by the user. Is this so or is there a way to specify the text.

Thanks,
 
Two ways to go about it:

- If your e-mail platform is Outlook, you can use Outlook VBA to send an email with all necessary bells and whistles. Not real simple, but definitely manageable

- You could also ask for the body on a userform, then copy the userform text to a worksheet cell on a newly created workbook, and use sendmail to send this workbook. Not as flashy or convenient, but a quicker fix.

Rob
[flowerface]
 
Hi,

ever tried the routing option? Al long as you're using MAPI I think it'll work:

Code:
Dim l_wkbSend As WorkBook

Set l_wkbSend = Application.Workbooks("BOOK1.XLS").Open
l_wkbSend.HasRoutingSlip = True

With l_wkbSend.RoutingSlip
    .Delivery = xlOneAfterAnother
    .Recipients = Array("Tom", "Dick", "Harry")
    .Subject = "Here is an xl workbook"
    .Message = "Sending you the workbook. Comments please asap."
End With
l_wkbSend.Route

Set l_wkbSend = Nothing


HTH - can't check code - using LoNo meself ...

Cheers
Nikki
 
The project I'm currently on uses Outlook, but as a company we use something else. Because I want to make this work once I'm back on our main system I was avoiding using the Outlook VBA.

Your idea for using a new workbook as a container for the body is an interesting approach and something that I'll definetly look into.

Thanks for your reply.
 
Nikita6003,

This may be the solution I was looking for. Just being lazy....but do you happen to know if the .recipients will accept a full email address?

i.e. somebody@somecompany.som

Or does it require access to a "centralized" mail list?

Thanks,
 
Well, as far as I can remember it'll work with internet email addresses such as name@wotsit.com

But the only way to be sure is to give it a go ...

Cheers - & good luck ;-)
Nikki
 
I tested it on my boyfriend's pc - he's got outlook xpress - and it worked there - got a msg sent to my hotmail account!

Chers
Nikki
 
Only thing it does it attaches this bit of text to your message:

The attached document has a routing slip. "When you are done reviewing this document, choose Next Routing Recipient from the Microsoft Excel Send To menu on the File menu to return the document to its sender."

Dunno if that can be suppressed ..

Cheers again
Nikki
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top