-
Notifications
You must be signed in to change notification settings - Fork 0
/
tuttotelFE.py
39 lines (29 loc) · 1.35 KB
/
tuttotelFE.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import os
import win32com.client as client
from PIL import ImageGrab
workbook_path = r"C:\Users\Raffaele.Sportiello\OneDrive - Wolters Kluwer\Documents\Dashboard inflow\Dashboard inflow canali e prodotti\Dashboard inflow - Raffaele.xlsb"
excel = client.Dispatch('Excel.Application')
wb = excel.Workbooks.Open(workbook_path)
sheet = wb.Sheets.Item("TuttotelFE")
copyrange= sheet.Range('B5:G30')
copyrange.CopyPicture(Appearance=1, Format=2)
ImageGrab.grabclipboard().save(r'C:\Users\Raffaele.Sportiello\OneDrive - Wolters Kluwer\Documents\Dashboard inflow\Dashboard inflow canali e prodotti\Speciali\TuttotelFE.png')
image_path = r'C:\Users\Raffaele.Sportiello\OneDrive - Wolters Kluwer\Documents\Dashboard inflow\Dashboard inflow canali e prodotti\Speciali\TuttotelFE.png'
html_body = """
<div>
<p>Buongiorno Claudio,<br><br>
riporto in calce l’aggiornamento sui dati di inflow di Tuttotel FE.<br><br>
Un saluto,<br>Raffaele<br><br></p>
</div>
<div>
<img src={}></img>
</div>
"""
outlook = client.Dispatch('Outlook.Application')
message = outlook.CreateItem(0)
message.To = "[email protected]"
message.CC = "[email protected]"
message.Subject = 'Tuttotel FE'
message.HTMLBody = html_body.format(image_path)
message.Display()
#message.Send()