![]() ![]() ![]() ‘ Use Environ to find current users Appdata path (e.g. ‘ Get the current ‘My Documents’ folder – ADD the sub-folder with the template ' TemplatePath = GetMyDocumentsPath() & "\Outlook Templates\" ‘ More flexible options that check current users setup to find template location ' TemplatePath = "C:\Users\\AppData\Roaming\Microsoft\Templates\" ‘ Set template location and name – REPLACE with users folder name. ‘ Fully hard-coded path to template folder ' TemplatePath = "C:\Users\freddagg\AppData\Roaming\Microsoft\Templates\" ‘ TEMPLATE LOCATION – several options available from fully hard-coded onwards. ‘ name of template file TemplateName = "My weekly report.oft" Sub NewEmailWeeklyReport() Dim TemplateName, TemplatePath As String There’s also a function to get the current My Documents folder. See the comments to explain various options available. Here’s the full VBA code to make a new email based on a template file.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |