Posting a workbook to Outlook

pcc

Well-known Member
Joined
Jan 21, 2003
Messages
1,353
I have the code below courtesy of this forum, that allows the current workbook to be posted as an attachement in an E-mail sent to a public folder on the company's Outlook system, and this works fine.



Code:
Sub test_code()
Dim nam As String
nam = "Bid sheet update"
Dim EmailTo As String 'email to the public folders
Dim oApp As Object 'Outlook.Application
Dim oItem As Object 'Outlook.MailItem
Dim recipients As String
recip = "foldername@companyname.com"
Set oApp = CreateObject("Outlook.Application")
Set oItem = oApp.CreateItem(0)
With oItem
.To = recip
.Subject = nam
.Body = "Some text here"
.attachments.Add ActiveWorkbook.FullName
.Importance = 0 ' 2= HIGH importance, Low = 0, Medium = 1
.Send
End With
Set oItem = Nothing
Set oApp = Nothing

End Sub


What I would ideally like to do is post the workbook itself (ie not as an E-mail attachment). The only way I know is to drag and drop the file from Explorer to Outlook, but I would like to do this using Excel VB. Can anyone offer any assisatance?

Thanks
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Anyone have any ideas? I would really like to get the workbook posted directly rather than as an attachment.

All suggestions welcomed!
 
Upvote 0
Thanks for the link - I am checking it out right now.
Cheers
 
Upvote 0
Need help in sending emails

Hi there!

Would highly appreciate if somebody could get me the codes for my two tasks.

1) I've a worksheet which maintains client details in a tabular form (columns being client ID, name, address, DOB, bank name, Bank account no,email, telephone no, etc).

I need to update this info (every year). For that I need to send emails to all the clients. The email would mention the details I've in my file for that particular client. The client would communicate to us if any of these details are changed.

Can someone get a code for me to do this??

2) This should be very simple. We need to inform each new clients\ the client ID allotted to him. The client ID is say in column B and the client email ID is in column E. The macro should send the email to the email address in column E of the active row. In the body of the message, it should say that "Your client ID is (Col B of that row)"

I hope somebody helps.

Cheers
 
Upvote 0

Forum statistics

Threads
1,214,522
Messages
6,120,022
Members
448,939
Latest member
Leon Leenders

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