T
ton
hi,
it is not difficult to send an email in VB using the outlook model.
Especially when you just sent plain text
However what I want is the following:
I'want to use the VB to add or insert some text in the template default
style of the newmailitem.
This is how my code looks like:
Err.Clear
Set TheApp = GetObject(, "Outlook.Application")
If Err.Number <> 0 Then
Set TheApp = CreateObject("Outlook.Application")
Quit = True
End If
Err.Clear
On Error Resume Next
With TheApp
Set TheNameSpace = .GetNamespace("mapi")
If OFTfile<>"" Then
Set TheMailItem = .CreateItemFromTemplate(OFTfile)
Else
Set TheMailItem = .CreateItem(olMailItem)
End If
TheMailItem.Display 'WHEN DISPLAYING HERE THE TEMPALTE IS LOADED
End With
With TheMailItem
.Recipients.Add Adres
.Subject = Subject
If Body <> "" Then
.Body = Body '.HTMLbody=Body AFTER THIS LINE WE GOT A PROBLEM
End If
End With
'the problem is that the backgroud is white, and the tamplate was a
beautifull watermark picture in it.
So how can I keep the formatting
Just tell me with wich outlook version I can achieve this result
And how can I get it !!
Thank YOU all
ton
it is not difficult to send an email in VB using the outlook model.
Especially when you just sent plain text
However what I want is the following:
I'want to use the VB to add or insert some text in the template default
style of the newmailitem.
This is how my code looks like:
Err.Clear
Set TheApp = GetObject(, "Outlook.Application")
If Err.Number <> 0 Then
Set TheApp = CreateObject("Outlook.Application")
Quit = True
End If
Err.Clear
On Error Resume Next
With TheApp
Set TheNameSpace = .GetNamespace("mapi")
If OFTfile<>"" Then
Set TheMailItem = .CreateItemFromTemplate(OFTfile)
Else
Set TheMailItem = .CreateItem(olMailItem)
End If
TheMailItem.Display 'WHEN DISPLAYING HERE THE TEMPALTE IS LOADED
End With
With TheMailItem
.Recipients.Add Adres
.Subject = Subject
If Body <> "" Then
.Body = Body '.HTMLbody=Body AFTER THIS LINE WE GOT A PROBLEM
End If
End With
'the problem is that the backgroud is white, and the tamplate was a
beautifull watermark picture in it.
So how can I keep the formatting
Just tell me with wich outlook version I can achieve this result
And how can I get it !!
Thank YOU all
ton