
ObjTask.Body = objTask.Body & vbCr & "-" & vbCr & objTempMail.Body ObjTempMail.HTMLBody = objTextStream.ReadAll Set objTextStream = objFileSystem.OpenTextFile(strHTMLFile) Set objFileSystem = CreateObject("Scripting.FileSystemObject")

Set objTempMail = objOutlookApp.CreateItem(olMailItem) Set objHTMLFile = (xlSourceRange, strHTMLFile, objTempWorksheet.Name, ) StrHTMLFile = strTempFolder & "\Temp" & Format(Now, "yyyymmddhhmmss") & ".htm" StrTempFolder = CStr(Environ("USERPROFILE")) & "\AppData\Local\Temp" Set objTempWorksheet = objTempWorkbook.Sheets(1) Set objTask = objOutlookApp.CreateItem(oltaskitem)įor Each objWorksheet In ActiveWorkbook.Sheets Set objOutlookApp = CreateObject("Outlook.Application")
#How to create tasks in outlook code
#How to create tasks in outlook how to
Subsequently, enable “Microsoft Outlook Object Library”, about which you can refer to “ How to Add an Object Library Reference in VBA“.Then, press “Alt + F11” to trigger Excel VBA editor.Method 2: Copy Excel Workbook to Body of an Outlook Task via VBA Code At once, a new Outlook task will display, which have been attached with the current Excel workbook, like the following screenshot.Eventually, after returning to the Excel workbook, click the new button in Quick Access Toolbar.Afterwards, click “Add >” button in center.Then, locate and pitch on “Create Microsoft Outlook Task” command.First off, select “Commands Not in the Ribbon” from the list of “Choose commands from”.Later, in the new “Excel Options” window, on “Quick Access Toolbar” tab, add the “Create Microsoft Outlook Task” command to Quick Access Toolbar.Next, choose “More Commands” from the drop down list.

Then, click the down arrow button in the Quick Access Toolbar.In the first place, open the specific Excel workbook.Method 1: Use “Create Microsoft Outlook Task” Command in MS Excel Now read on to get the 2 means in detail. If what you want is to quickly copy all the contents of all worksheets to an Outlook task’s body, you can use the Method 2 instead. But, it’ll only attach the Excel workbook to an Outlook task. Actually, Microsoft Excel comes with a native feature of “Create Microsoft Outlook Task”, like the Method 1 introduced in the followings. Thus, in this article, we will introduce 2 simple approaches to get it.Īt times, you may want to create an Outlook task from an Excel file for follow up or other reasons. Some users are eager to quickly create an Outlook task for an Excel workbook.
