Python Outlook Auto-Forward Script
Budget: $30 – $250 USD
I need a small Windows-only Python script that automates a very specific routine inside my existing Outlook 2010 installation.
Here is the exact flow I want the code to perform on an endless loop:
1. Launch Outlook 2010, jump to the Sent Items folder, select the newest message, choose Forward.
2. In the draft that opens:
• Strip the “FW:” tag from the subject line.
• Delete the automatic header block that appears at the top of the body when a mail is forwarded (“From: … Sent: … To: … Subject: …”).
3. Open the file C:\Users\<myUser>\Desktop\emails.txt, grab the first 250 addresses, cut them out of the file so they are no longer present, and paste them into the BCC field of the draft.
4. Send the message.
5. Return to step 1 and repeat until the file is emptied (or keep looping indefinitely if you prefer to read it again once refilled).
The job is finished when I can double-click a .py file, watch Outlook and the emails.txt file update exactly as described, and leave it running without manual intervention.
Please build it with the pywin32 (win32com) library for Outlook control. If you need to manipulate Notepad++ you may use pywinauto or a similar GUI-automation tool, but reading and rewriting the text file directly in Python is perfectly fine.
Include at least basic error handling so the script won’t crash if Outlook is already open, the Sent folder is empty, or fewer than 250 emails remain in the file.
Deliverables:
• The complete, well-commented .py script
• A short README explaining required Python version, external libraries, and how to launch the loop
Let me know if anything in the flow needs clarifying; otherwise I’m ready to test your solution right away.
Here is the exact flow I want the code to perform on an endless loop:
1. Launch Outlook 2010, jump to the Sent Items folder, select the newest message, choose Forward.
2. In the draft that opens:
• Strip the “FW:” tag from the subject line.
• Delete the automatic header block that appears at the top of the body when a mail is forwarded (“From: … Sent: … To: … Subject: …”).
3. Open the file C:\Users\<myUser>\Desktop\emails.txt, grab the first 250 addresses, cut them out of the file so they are no longer present, and paste them into the BCC field of the draft.
4. Send the message.
5. Return to step 1 and repeat until the file is emptied (or keep looping indefinitely if you prefer to read it again once refilled).
The job is finished when I can double-click a .py file, watch Outlook and the emails.txt file update exactly as described, and leave it running without manual intervention.
Please build it with the pywin32 (win32com) library for Outlook control. If you need to manipulate Notepad++ you may use pywinauto or a similar GUI-automation tool, but reading and rewriting the text file directly in Python is perfectly fine.
Include at least basic error handling so the script won’t crash if Outlook is already open, the Sent folder is empty, or fewer than 250 emails remain in the file.
Deliverables:
• The complete, well-commented .py script
• A short README explaining required Python version, external libraries, and how to launch the loop
Let me know if anything in the flow needs clarifying; otherwise I’m ready to test your solution right away.
Related categories:
Python
Windows Desktop
Software Architecture
C++ Programming
Scripting
Documentation
Automation