2 attempt: Why is CreateItemFromTemplate so slow?

F

Filips Benoit

Dear All,

The testcode below needs 37 sec. to display the mail, WHY so slow.

Private Sub Command1_Click()
Dim ol As Object
Dim msg As Outlook.MailItem
Dim strBody As String

Set ol = CreateObject("Outlook.Application")
Set msg =
ol.CreateItemFromTemplate("C:\Documents\000FILIP\VoorAnderen\Ycomm\YcommPMS\
EmailTemplates\Template1.oft")
strBody = msg.Body
strBody = Replace(strBody, "FirstName", "Filips")
msg.Body = strBody
msg.To = "(e-mail address removed)"
msg.Display
End Sub
 
M

Milly Staples [MVP - Outlook]

Why are you not posting this in a group for Outlook programming? You would
have probably gotten an answer on your first posting.

In the future, try posting in the group most relevant to the type of problem
you are trying to solve. This is a general group and deals with general
type question. Programming groups are specifically for programming
questions and are where the real experts with programming hang out.

--
Milly Staples [MVP - Outlook]

Post all replies to the group to keep the discussion intact. Due to
the (insert latest virus name here) virus, all mail sent to my personal
account will be deleted without reading.

After furious head scratching, Filips Benoit asked:

| Dear All,
|
| The testcode below needs 37 sec. to display the mail, WHY so slow.
|
| Private Sub Command1_Click()
| Dim ol As Object
| Dim msg As Outlook.MailItem
| Dim strBody As String
|
| Set ol = CreateObject("Outlook.Application")
| Set msg =
|
ol.CreateItemFromTemplate("C:\Documents\000FILIP\VoorAnderen\Ycomm\YcommPMS\
| EmailTemplates\Template1.oft")
| strBody = msg.Body
| strBody = Replace(strBody, "FirstName", "Filips")
| msg.Body = strBody
| msg.To = "(e-mail address removed)"
| msg.Display
| End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top