Not sure if I should post this here!*12209

J

J.Alladien

Hello All,

I set up a default stationary in Outlook for every new message and it works
fine when I
do it manually,however when I automatically want to send e-mail through a
loop code from a Microsoft access Db it just sends the mail in standard
format,how can I fix this?

Thanks in advance!
 
D

Dirk Goldgar

J.Alladien said:
Hello All,

I set up a default stationary in Outlook for every new message and it
works
fine when I
do it manually,however when I automatically want to send e-mail through a
loop code from a Microsoft access Db it just sends the mail in standard
format,how can I fix this?


When you say it sends the mail in "standard format", do you mean plain text,
as oppoese to HTML format? How are you sending the message? Are you using
SendObject, or are you automating Outlook? If you're sending the message by
automating Outlook, you I believe you have to assign to the .HTMLBody
property rather than the .Body property.
 
J

J.Alladien

Hi Dirk,

I am using automation :
SEND = -1
'Arvin Meyer 03/12/1999
'Updated 7/21/2001
On Error GoTo Error_Handler

Dim objOutlook As Outlook.Application
Dim objEmail As Outlook.MailItem

Set objOutlook = CreateObject("Outlook.application")
Set objEmail = objOutlook.CreateItem(olMailItem)

With objEmail
.To = Forms![Names1]![E-mail Address]
.Subject = Forms![Names1]![SUB]
.Body = Forms![Names1]![Body]
.Attachments.Add "C:\PROMO.pdf"
'.attachments.Add "c:\Path\to\the\next\file.txt"
.SEND
'.ReadReceiptRequested
End With

Exit_Here:
Set objOutlook = Nothing
Exit Sub

Error_Handler:
MsgBox Err & ": " & Err.Description
Resume Exit_Here

I made a special theme for all my mails,and when I send automatically it
appears in standard HTML and not my HTML theme!
I tried the .HTML body but the same thing happens!

Meanwhile I also posted in OUTLOOK and I got this reply:
"that is because automation hooks in differently - it will never use
stationery."
 
C

Clif McIrvin

Meanwhile I also posted in OUTLOOK and I got this reply:
"that is because automation hooks in differently - it will never use
stationery."

I've seen references to something called Outlook Redemption -- which
appears to use different mechanisms for programatically controlling
Outlook than automation does. It might be worth looking up.

If you don't have any luck finding redemption let me know & I'll see if
I can locate the thread (office developer vba ng, I think) -- it
included a link to the redemption home page.
 
D

Dirk Goldgar

J.Alladien said:
I made a special theme for all my mails,and when I send automatically it
appears in standard HTML and not my HTML theme!
I tried the .HTML body but the same thing happens!

Meanwhile I also posted in OUTLOOK and I got this reply:
"that is because automation hooks in differently - it will never use
stationery."


If the answer came from Diane Poremsky, I expect she's right. I would have
thought there'd be a way to do it via the Outlook object model, but maybe it
isn't exposed.

Failing that, the only thing I can think of would be to send yourself a
message manually, copy the HTML of that message including the stationery
attachment, and modify that in to create the string you assign to the
message item's .HTMLBody property. Might work.
 

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