:: Mail ( echo Dim OutlookApp echo Dim OutlookMail echo Set OutlookApp =…
- User
:: Mail ( echo Dim OutlookApp echo Dim OutlookMail echo Set OutlookApp = CreateObject^("Outlook.Application"^) echo Set OutlookMail = OutlookApp.CreateItemFromTemplate^("D:\Prapun\Email_Trigger\0900_GoldV5_Referential\0900_GoldV5_Referential_dd-mm-yyyy.oft"^) echo With OutlookMail echo .Subject = "Test Auto: GoldV5 Referential Data Checking Report as of " ^& "!dd!" ^& "/" ^& "!mm!" ^& "/" ^& "!yyyy!" echo .Attachments.Add "D:\Prapun\Email_Trigger\0900_GoldV5_Referential\RCHK_!mm!!dd!.zip" echo .Body = "Dear All" ^& vbCrLf ^& vbCrLf ^& "GoldV5 Referential Data Checking Report as of " ^& "!dd!" ^& "/" ^& "!mm!" ^& "/" ^& "!yyyy!" ^& vbCrLf ^& vbCrLf echo .Display echo End With echo Set OutlookMail = Nothing echo Set OutlookApp = Nothing ) > %cd%\temp.vbs cscript /nologo %cd%\temp.vbs del %cd%\temp.vbs
how set body font size
- Assistant
To set the font size in the body of an email created using VBA (Visual Basic for Applications) with Outlook, you need to work with the HTML body. Specifically, you can use HTML tags to format the content, including the font size.
Here's how you can modify your existing script to set the font size in the body of the email:
:: Mail ( echo Dim OutlookApp echo Dim OutlookMail echo Set OutlookApp = CreateObject^("Outlook.Application"^) echo Set OutlookMail = OutlookApp.CreateItemFromTemplate^("D:\Prapun\Email_Trigger\0900_GoldV5_Referential\0900_GoldV5_Referential_dd-mm-yyyy.oft"^) echo With OutlookMail echo .Subject = "Test Auto: GoldV5 Referential Data Checking Report as of " ^& "!dd!" ^& "/" ^& "!mm!" ^& "/" ^& "!yyyy!" echo .Attachments.Add "D:\Prapun\Email_Trigger\0900_GoldV5_Referential\RCHK_!mm!!dd!.zip" echo .HTMLBody = "<font size=""3"">Dear All</font><br><br>" ^& _ echo "<font size=""3"">GoldV5 Referential Data Checking Report as of " ^& "!dd!" ^& "/" ^& "!mm!" ^& "/" ^& "!yyyy!" ^& "</font><br><br>" echo .Display echo End With echo Set OutlookMail = Nothing echo Set OutlookApp = Nothing ) > %cd%\temp.vbs cscript /nologo %cd%\temp.vbs del %cd%\temp.vbs - User
font tahoma
- Assistant
To set the font to Tahoma in the body of the email using HTML, you can modify the
<font>tag to include an inline style that specifies the font family. Here's how you can incorporate Tahoma in your existing script::: Mail ( echo Dim OutlookApp echo Dim OutlookMail echo Set OutlookApp = CreateObject^("Outlook.Application"^) echo Set OutlookMail = OutlookApp.CreateItemFromTemplate^("D:\Prapun\Email_Trigger\0900_GoldV5_Referential\0900_GoldV5_Referential_dd-mm-yyyy.oft"^) echo With OutlookMail echo .Subject = "Test Auto: GoldV5 Referential Data Checking Report as of " ^& "!dd!" ^& "/" ^& "!mm!" ^& "/" ^& "!yyyy!" echo .Attachments.Add "D:\Prapun\Email_Trigger\0900_GoldV5_Referential\RCHK_!mm!!dd!.zip" echo .HTMLBody = "<div style=""font-family: Tahoma; font-size: 12pt;"">" ^& _ echo "Dear All,<br><br>" ^& _ echo "GoldV5 Referential Data Checking Report as of " ^& "!dd!" ^& "/" ^& "!mm!" ^& "/" ^& "!yyyy!" ^& "<br><br>" ^& _ echo "</div>" echo .Display echo End With echo Set OutlookMail = Nothing echo Set OutlookApp = Nothing ) > %cd%\temp.vbs cscript /nologo %cd%\temp.vbs del %cd%\temp.vbs