Create Outlook mail using default template

  • 13 years ago
    If I click the New-button in Outlook, an new email-item is created, using our companies email template. However, if I use code like this to create a new email-item, I get a blank email without formatting.

        Dim app As Outlook.Application
        Dim em As Outlook.MailItem
        Set app = CreateObject("Outlook.Application")
        Set em = app.CreateItem(olMailItem)
        With em
            .To = "test@test.com"
            .Subject = "test"
            .Body = "testbody"
            .Send
        End With
        Set em = Nothing
        Set app = Nothing












    - So how can I create a new mail item based on our companies email template?
    - If I have to use CreateItemFromTemplate, how can I retrieve the path to the default email template?
    - Before actually sending, I want the user to be able to add some text to the body, and to allow the user to manually send the email whenever he is ready. How can I achieve that?









Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“The difference between theory and practice is smaller in theory than in practice.”