Controlling Outlook from Excel

tiredofit

Well-known Member
Joined
Apr 11, 2013
Messages
1,924
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Using VBA in Excel, it is possible to control Outlook but to what extent?

The problem I have is as follows:

Suppose Person A e-mails Person B. The e-mail contains 1 Excel workbook, along with a pdf and a Word document.

When Person B receives the e-mail, they can:


Accept (in which case the e-mail along with all THREE attachments are forwarded to Person C).

Reject (in which case the e-mail along with all THREE attachments are returned to Person A).


Can all of the above be done with just Excel using VBA or must some VBA be added to Person A / B's Outlook or perhaps even utilising Rules in Outlook?


Thanks
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Where exactly would the controlling Excel workbook be?
 
Upvote 0
Person A has it saved in his C drive.

If it's only the controlling Excel workbook that needs to "travel", I've already done that using just VBA in Excel.

The difficulty lies in the additional attachments.
 
Last edited:
Upvote 0
The workbook would have to be open and already running on the relevant machine when the email arrived.
 
Upvote 0
Let's assume that will be the case.

So far, my code to attach itself (ie the controlling workbook) is as follows:

Code:
objMail.Attachments.Add ThisWorkbook.FullName

so how can I attach the other two attachments (pdf and word doc) as well?
 
Last edited:
Upvote 0
Just repeat that line and specify the full path and file name for each attachment.
 
Upvote 0
Correct me if I'm wrong but doesn't that involve Person B saving all three attachments when he receives the e-mail, then attaching them again?


At the moment what I have already done is when Person B receives the e-mail (containing ONLY the controlling workbook), he opens the attachment, which contains a button (with VBA behind) to Accept or Reject.


If Reject, an e-mail is automatically sent back to Person A, along with the workbook.

If Accept, an e-mail is automatically sent to Person C, with the workbook.


Nobody has to ever manually attach attachments (admittedly it's the scenario where only a single workbook is attached).
 
Upvote 0
Perhaps a workaround would be when Person B receives the e-mail (containing the 3 attachments, controlling wb plus pdf and word), he opens the wb, clicks the button, which somehow saves the 3 attachments in the currently opened e-mail.

That way it can attach it later.
 
Upvote 0

Forum statistics

Threads
1,223,706
Messages
6,173,998
Members
452,542
Latest member
Bricklin

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