Re : Outlook 2003 - Turn Word on or off as e-mail editor or viewer



I think I found out => .BodyFormat = olFormatPlain instead of .BodyFormat =
olFormatHTML , but since the variable "corps" contains html tags there are
big changes to make and it may not be worth

I think I will just exit the procedure if the editor is mail unless I find a
way to get rid of these tags

I had an other problem : When I send an html mail with my code to someone
that uses word editor, if my mail is transferred or answered, the original
body of my mail is lost

Thanks


"thomas" <nomail> a écrit dans le message de groupe de discussion :
uz6aXuhjJHA.4976@xxxxxxxxxxxxxxxxxxxxxxx

oh thanks

i should have seen it

detection works fine

but what should be the code when oInspector.IsWordMail ? where can i find
examples ?

Thanks


"Ken Slovak - [MVP - Outlook]" <kenslovak@xxxxxxxx> a écrit dans le message
de groupe de discussion : ODZQJ0ejJHA.2460@xxxxxxxxxxxxxxxxxxxxxxx
The names of the Inspector variable aren't the same on these lines:

Set olInspector = MonMail.GetInspector

If oInspector.IsWordMail Then ' The 424 error is here

Use the same variable name in both lines.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"thomas" <nomail> wrote in message
news:eRA%234QVjJHA.6124@xxxxxxxxxxxxxxxxxxxxxxx
My code is :


Private Function EnvoiMail_HTML(Adresse As String, Objet As String, Corps
As
String, Optional Pièce As String, Optional Cc As String, Optional Bcc As
String, Optional Envoyer_Mail As Boolean)

Dim MonAppliOutlook As Outlook.Application
Dim MonMail As Outlook.MailItem
Dim MaPièce As Outlook.Attachments
Dim olInspector As Outlook.Inspector

Set MonAppliOutlook = CreateObject("Outlook.Application")
Set MonMail = MonAppliOutlook.CreateItem(olMailItem)
Set olInspector = MonMail.GetInspector

If oInspector.IsWordMail Then ' The 424 error is here
' is WordMail 'Just for test
Else
' no WordMail 'Just for test
End If


On Error Resume Next
With MonMail
If Affichage = True Then .Display Else
.GetInspector.CommandBars.Item("Insert").Controls("Signature").Controls(1).Execute
.To = Adresse
If Not IsNull(Cc) Then .Cc = Cc
If Not IsNull(Bcc) Then .Bcc = Bcc
.Subject = Objet
If Not IsNull(Pièce) Then
Set MaPièce = .Attachments
T = Split(Pièce, ";")
For i = 0 To UBound(T)
MaPièce.Add T(i), olByValue
Next i
End If
.BodyFormat = olFormatHTML
.HTMLBody = Corps & .HTMLBody
If Envoyer_Mail = True Then .Send
End With

Set MonAppliOutlook = Nothing
Set MonMail = Nothing


End Function




"thomas" <nomail> a écrit dans le message de groupe de discussion :
Oikn53IjJHA.5588@xxxxxxxxxxxxxxxxxxxxxxx
Thanks but i get a 424 error on "If oInspector.IsWordMail Then"

.



Relevant Pages

  • Re: Removing html tags from field
    ... You didn't happen to name the module KillHTML, ... >> Public Function KillHTML(sText As String, ... Dim iRight As Integer ... >>> Is there a way to remove html tags from a memo field? ...
    (microsoft.public.access.queries)
  • Re: Removing html tags from field
    ... Public Function KillHTML(sText As String) As String ... Dim iLeft As Integer ... Dim iRight As Integer ... > Is there a way to remove html tags from a memo field? ...
    (microsoft.public.access.queries)
  • Re: Removing html tags from field
    ... > Public Function KillHTML(sText As String, ... > Dim iRight As Integer ... > Microsoft Access 2003 VBA Programmer's Reference ... >> Is there a way to remove html tags from a memo field? ...
    (microsoft.public.access.queries)
  • Re : Sending mails from Excel 2003 - Outlook signature
    ... Private Function EnvoiMail_HTML_New(Adresse As String, Objet As String, ... Corps As String, Optional Pièce As String, Optional Cc As String, Optional ... Dim MonAppliOutlook As Outlook.Application ... Set MonMail = MonAppliOutlook.CreateItem ...
    (microsoft.public.outlook.program_vba)
  • Re : Sending mails from Excel 2003 - Outlook signature
    ... Private Function EnvoiMail_HTML_New(Adresse As String, Objet As String, ... Corps As String, Optional Pièce As String, Optional Cc As String, Optional ... Dim MonAppliOutlook As Outlook.Application ... Set MonMail = MonAppliOutlook.CreateItem ...
    (microsoft.public.outlook.program_vba)