Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
LPS LPS is offline
external usenet poster
 
Posts: 108
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 210
Default 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   Report Post  
Posted to microsoft.public.excel.programming
LPS LPS is offline
external usenet poster
 
Posts: 108
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 156
Default 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   Report Post  
Posted to microsoft.public.excel.programming
LPS LPS is offline
external usenet poster
 
Posts: 108
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Modifying Macro simplymidori[_2_] Excel Discussion (Misc queries) 3 April 13th 08 04:17 PM
Need help modifying a macro EAHRENS Excel Discussion (Misc queries) 13 March 31st 06 12:22 AM
Modifying an Old Excel Macro LPS Excel Programming 3 January 9th 06 02:54 PM
2nd try --Macro to transfer data in an Excel sheet (2000) in Access 2000 ( code to replace what wizard do) André Lavoie Excel Programming 0 September 27th 05 01:50 PM
Create macro to download access 2000 table to excel 2000 spreadsheet Tushar[_2_] Excel Programming 3 October 21st 04 02:44 PM


All times are GMT +1. The time now is 12:35 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"