Re: Prevent attachments for being inserted into the body

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Sue Mosher [MVP-Outlook] (suemvp_at_outlookcode.com)
Date: 02/01/05


Date: Tue, 1 Feb 2005 10:33:30 -0500

And what's different? An HTML-format message always shows attachments in a
separate little attachment pane, not in the message body.

-- 
Sue Mosher, Outlook MVP
Author of
     Microsoft Outlook Programming - Jumpstart for
     Administrators, Power Users, and Developers
     http://www.outlookcode.com/jumpstart.aspx
"Hans Andersen" <hja@indu-flex.dk> wrote in message 
news:%23%23f%23KIHCFHA.3096@TK2MSFTNGP14.phx.gbl...
> The message format is html.
> Deferent in the location at the attachment.
>
>>> That is not completely true.
>>> if you replace
>>>    olMail.Attachments.Add HtmFile, olByValue
>>> with
>>>    Dim s As String
>>>    s = olMail.HTMLBody
>>>    olMail.Attachments.Add HtmFile, olByValue
>>> the result will be deferent.
>>> Unfortunately it makes Outlook go into panic security mode.
>>> It can also be done from the UI.
>>>
>>> I can not be the only one how wants separate the attachments from the 
>>> body!?
>>>
>>> "Sue Mosher [MVP-Outlook]" <suemvp@outlookcode.com> wrote in message 
>>> news:ehZAQaGCFHA.328@tk2msftngp13.phx.gbl...
>>>> The placement of the attachments depends on the message format. RTF 
>>>> puts them inline. HTML and plain text don't.
>>
>>>>
>>>>
>>>> "Hans Andersen" <hja@indu-flex.dk> wrote in message 
>>>> news:%23WlIgfDCFHA.1888@TK2MSFTNGP10.phx.gbl...
>>>>> Hi all,
>>>>>
>>>>> I am trying to attach a htm file to an email in outlook 2003 with vba, 
>>>>> but the file is inserted into the body. How do I change that.  Code 
>>>>> below
>>>>>
>>>>> Hans
>>>>>
>>>>>
>>>>> Private Sub VedHaeftTilbud(HtmFile As String)
>>>>>
>>>>>    Dim olApp As Outlook.Application
>>>>>    Dim olMail As Outlook.MailItem
>>>>>    Dim obj As Object
>>>>>
>>>>>    Set olApp = New Outlook.Application
>>>>>
>>>>>    Set obj = Me.GetCurrentItem()
>>>>>    Set olMail = obj
>>>>>
>>>>>    olMail.Attachments.Add HtmFile, olByValue
>>>>>
>>>>>    Set olApp = Nothing
>>>>>
>>>>> End Sub
>>>>>
>>>>> Function GetCurrentItem() As Object
>>>>>    Dim objApp As Outlook.Application
>>>>>
>>>>>    Set objApp = CreateObject("Outlook.Application")
>>>>>    On Error Resume Next
>>>>>    Select Case TypeName(objApp.ActiveWindow)
>>>>>        Case "Explorer"
>>>>>            Set GetCurrentItem = 
>>>>> objApp.ActiveExplorer.Selection.Item(1)
>>>>>        Case "Inspector"
>>>>>            Set GetCurrentItem = objApp.ActiveInspector.CurrentItem
>>>>>        Case Else
>>>>>            ' anything else will result in an error, which is
>>>>>            ' why we have the error handler above
>>>>>    End Select
>>>>>
>>>>>    Set objApp = Nothing
>>>>> End Function
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
> 


Relevant Pages

  • RE: Help with my code.
    ... Try Picture Attachments Wizard for Outlook: ... Dim inbox As MAPIFolder ... Dim FileName As String ...
    (microsoft.public.outlook.program_vba)
  • Mail Merge with Attachments
    ... Mail Merge to E-mail with Attachments ... is not necessary for Outlook to be nominated as the default mail ... running the macro will cause the following warning message ... Dim Source As Document, Maillist As Document ...
    (microsoft.public.office.developer.outlook.vba)
  • Re: Error handling for missing Outlook attachments
    ... When the directory path and/or file name for one or more attachments is ... Outlook Mailbox, and send the problem email to this, instead of sending the ... Dim oApp As Outlook.Application ... oMailItem.Recipients.Add Cells'Identify Email Recipient ...
    (microsoft.public.excel.programming)
  • Re: How to save attachment automatically in Outlook 2003?
    ... very helpful and the script works very well. ... Sue Mosher, Outlook MVP ... Dim myOlApp As Outlook.Application ... These samples show various ways to save attachments that you could incorporate into the basic structure and run with no conditions: ...
    (microsoft.public.outlook.program_vba)
  • Re: STILL IS NOT AVAILABLE... Run A Script not listed in rules wiz
    ... Don't move the copy until you've finished deleting the attachments. ... Author of Microsoft Outlook 2007 Programming: ... Dim objNamespace As NameSpace ... Alan Moseley IT Consultancy ...
    (microsoft.public.outlook.program_vba)