0

I have an Excel macro that opens Internet Explorer, searches & requests an export for each item in Column A.

The export is sent to my Outlook email and automatically filters into my Import/Export folder. At that point, when it filters into my Import/Export folder, I'd like an Outlook macro to check if the Excel macro is running, because I receive exports at other times too.

If the Excel macro is running I'd like to change/edit the subject line of the email that was just filtered to include the text from a certain HTML tag (which I have the ID for) on the current page from Internet Explorer.

** Is this possible? If you have any suggestion on a better way to go about this I'd be happy to hear it.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
CaffeinatedMike
  • 1,537
  • 2
  • 25
  • 57
  • I think the result would be the same if you sent mail with the required Subject. – niton Feb 07 '16 at 17:10
  • I don't think you understand the goal I'm trying to accomplish. The subject needs to be changed automatically. I'm not sending the email when I request the export. The system sends me an email with the same Subject that is used for every export. – CaffeinatedMike Feb 07 '16 at 17:14

1 Answers1

1

In Excel, just before the first export save 1 to a text file. Once all exports are done, put Excel to sleep for a short time so the mail can reach Outlook then save 0 to the text file.

In Outlook, assume Excel is requesting exports if the text file contains 1.

Edit:
Sample code for Excel How to create and write to a txt file using VBA
Sample code for Outlook: Read/Parse text file line by line in VBA

Community
  • 1
  • 1
niton
  • 8,771
  • 21
  • 32
  • 52