2 attempt: Why is CreateItemFromTemplate so slow?

  • Thread starter Thread starter Filips Benoit
  • Start date Start date
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
 
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
 
Back
Top