Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Modifying an Excel 2000 Macro
Using Excel 2000, I have this macro, listed below, which creates a new blank
e-mail message. I would like to modify it so that when the macro executes and the new e-mail is created an e-mail address automatically is entered in the To: field. Sub Send_Form() ' ' Send_Form Macro ' Macro recorded 20/03/2006 by LPS. Used to send form as an E-Mail attachment ' ' Application.Dialogs(xlDialogSendMail).Show End Sub Thank you for any and all help. -- LPS |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Modifying an Excel 2000 Macro
If you set a reference to the Outlook Object model, you can populate all the
fields in your mail message: Sub test() Dim ol As Outlook.Application Set ol = New Outlook.Application Set oMessage = ol.CreateItem(olMailItem) oMessage.Display oMessage.To = " End Sub -- http://HelpExcel.com 516-984-0252 "LPS" wrote: Using Excel 2000, I have this macro, listed below, which creates a new blank e-mail message. I would like to modify it so that when the macro executes and the new e-mail is created an e-mail address automatically is entered in the To: field. Sub Send_Form() ' ' Send_Form Macro ' Macro recorded 20/03/2006 by LPS. Used to send form as an E-Mail attachment ' ' Application.Dialogs(xlDialogSendMail).Show End Sub Thank you for any and all help. -- LPS |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Modifying an Excel 2000 Macro
Thank you for your suggestion. I copied and pasted the code into my macro
and tried it and got the following error: Compile Error: User-defined type not defined. I know very little about macros so if I needed to edit your code, I would not know what edits to make. Suggestions??? Again, thanks for your help -- LPS "galimi" wrote: If you set a reference to the Outlook Object model, you can populate all the fields in your mail message: Sub test() Dim ol As Outlook.Application Set ol = New Outlook.Application Set oMessage = ol.CreateItem(olMailItem) oMessage.Display oMessage.To = " End Sub -- http://HelpExcel.com 516-984-0252 "LPS" wrote: Using Excel 2000, I have this macro, listed below, which creates a new blank e-mail message. I would like to modify it so that when the macro executes and the new e-mail is created an e-mail address automatically is entered in the To: field. Sub Send_Form() ' ' Send_Form Macro ' Macro recorded 20/03/2006 by LPS. Used to send form as an E-Mail attachment ' ' Application.Dialogs(xlDialogSendMail).Show End Sub Thank you for any and all help. -- LPS |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Modifying an Excel 2000 Macro
Look in the help section of the VBE and look for Built-In Dialog Box
Argument Lists under xlDialogSendMail you will see some arguments to the right you can use for Subject, Recipient, and return receipt. Heres an example: Application.Dialogs(xlDialogSendMail).Show arg1:="Recipients Name", arg2:="My Subject" Good luck, Sandy LPS wrote: Using Excel 2000, I have this macro, listed below, which creates a new blank e-mail message. I would like to modify it so that when the macro executes and the new e-mail is created an e-mail address automatically is entered in the To: field. Sub Send_Form() ' ' Send_Form Macro ' Macro recorded 20/03/2006 by LPS. Used to send form as an E-Mail attachment ' ' Application.Dialogs(xlDialogSendMail).Show End Sub Thank you for any and all help. -- LPS |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Modifying an Excel 2000 Macro
Thank you Sandy. That helped tremendously. Great tip.
-- LPS "Sandy" wrote: Look in the help section of the VBE and look for Built-In Dialog Box Argument Lists under xlDialogSendMail you will see some arguments to the right you can use for Subject, Recipient, and return receipt. Heres an example: Application.Dialogs(xlDialogSendMail).Show arg1:="Recipients Name", arg2:="My Subject" Good luck, Sandy LPS wrote: Using Excel 2000, I have this macro, listed below, which creates a new blank e-mail message. I would like to modify it so that when the macro executes and the new e-mail is created an e-mail address automatically is entered in the To: field. Sub Send_Form() ' ' Send_Form Macro ' Macro recorded 20/03/2006 by LPS. Used to send form as an E-Mail attachment ' ' Application.Dialogs(xlDialogSendMail).Show End Sub Thank you for any and all help. -- LPS |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Modifying Macro | Excel Discussion (Misc queries) | |||
Need help modifying a macro | Excel Discussion (Misc queries) | |||
Modifying an Old Excel Macro | Excel Programming | |||
2nd try --Macro to transfer data in an Excel sheet (2000) in Access 2000 ( code to replace what wizard do) | Excel Programming | |||
Create macro to download access 2000 table to excel 2000 spreadsheet | Excel Programming |