I am using a script that copies an excel sheet and pastes it into outlook but I am wondering if there's a way to copy the formatting and colour coding aswell?
Here is the script
import win32com.client as client
import pandas as pd
workbook_path = r'C:\sheet\to\excel\excel.xlsx'
df = pd.read_excel(workbook_path, sheet_name="Sheet1",index_col=False, nrows = 10, usecols = "A:AA")
html_body = """
<div>
<p>Hi All, </p>
<p>writing in here </p>
</div>
<div>
</div>
"""
body = df.to_html()
proper = html_body + body
outlook =client.Dispatch('Outlook.Application')
mail = outlook.CreateItem(0)
mail.To = 'emailAddress'
mail.HTMLBody = (proper)
mail.Display()