0

I'm trying to download emails that users saved in download folder.

I take the path but when i try to open the email file i get errors. The error: WinError 2

from datetime import datetime
import os
import pandas as pd
import win32com.client as win32

c = "c:\\Download"

outlook = win32.Dispatch("Outlook.Application")

for f in os.listdir(c):
    os.starfile(f)
    excel = f.Attachments

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45

1 Answers1

0

You are missing t on os.starfile, should be startfile

and

os.startfile(f) #  You are missing the path

so try

os.startfile(c + "\\" + f)
0m3r
  • 12,286
  • 15
  • 35
  • 71