Worksheet Selection to Outlook. How?

eddy

Well-known Member
Joined
Mar 2, 2002
Messages
521
Had a lot of help from TSTom and Snozgur but had recent crash and lost your E-Mail address's.

Need a macro that will:-
a) Select a range in worksheet (CopySheet) Range C3:H12 (Using Excel 2000)
b) Open Outlook (2000)
c) Past selection into text area whilsh maintaining formating.
Addressee will then be selected in the normal way via the Outlook address book.
Snozgur almost got the answer but it seemed very much O/S and Office version specific.
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Jack ..

Thanks a lot for your suggestions. I will play with your code to see if if I can get it to work..
This is the code that almost works. It works for Smozur but not me. I supect its due to different OS/ or Office progs. Not you need to use the Outlook Add In :-

'This sub set the range
Sub CallSub()
Dim newRange As Range
Set newRange = Sheet2.Range("B1:E38")
Call CreateNewEmail(newRange)
End Sub

'This sub creates a new email message and fill the subject and also body as your range data
Sub CreateNewEmail(myRange As Range)
Dim myOLApp As Outlook.Application

Set myOLApp = New Outlook.Application
Dim myOLItem As Outlook.MailItem
Set myOLItem = myOLApp.CreateItem(olMailItem)
myRange.Copy

myOLItem.Subject = "QUOTATION : " & Sheet2.Range("D2").Value
myOLItem.Display

SendKeys "%{TAB}"

SendKeys "{TAB 3}"
SendKeys "^v"

myOLItem.To = Sheet2.Range("H14").Value

End Sub
 
Upvote 0
sorry, Eddy -- I haven't coded for Save As HTML or for using Outlook before. I was going to at least get you started, but there's no references at all in my Help files about Saving As HTML, and the Macro Recorder records nothing when I try! :confused:

I am, of course, still stuck using Excel 97, but since you were searching for a version-independent solution I figured I would give it a shot. Still, I know the support and documentation of web publishing has to be better in 2000. I would investigate the VBE help files on the PublishObject and SaveAs methods, then see if someone else can provide basic code for you to tweak.

Jack's got a good start for you on controlling the Outlook portion of it; again, you'll need to check Outlook 2000's VB help files for the syntax for inserting a file as text only.

Good luck -- sorry I couldn't do more on the code front!

Cath
 
Upvote 0

Forum statistics

Threads
1,215,097
Messages
6,123,076
Members
449,094
Latest member
mystic19

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top