Opening mail attachments

  • Thread starter Thread starter Craig Berry
  • Start date Start date
C

Craig Berry

Hi,
I would like to open an attachement w/o having to click
the button "open it", the "save it to disk" is the
default setting. Can I change the default setting
from "save it to disk" to "open it?"
Outlook ver 10.0, build is 3513
Thanks
 
That is not an option - and further more you don't want to
do that - you'd have a virus in no time...
 
If you're just wanting to view picture attachments, try this macro that I posted
awhile back. It's safe, because it will only show pictures & won't show/run any
executables or other kinds of attachments.


Here's an Outlook macro I put together that provides a work-around by displaying
all the attachments from selected emails (you can select multiple messages) in
a new message. Image files will display properly - other attachments will not.

The macro copies attachments to 'c:\attachments_outlook' (creates the directory
if necessary). After displaying the attachments in a new message, it deletes
the files that were copied

When you're finished, just close the new message without saving. The only
drawback I see so far, is that Autosave (if enabled) will save a copy in
'Drafts' if the new message stays open past the set time limit. Also,
occasionally it doesn't delete the pictures from 'c:\attachments_outlook' for
some reason.

For easy access, put a shortcut to the macro on your Outlook toolbar.


Sub view_attachments()
On Error Resume Next

Dim oOL As Outlook.Application
Dim oSelection As Outlook.Selection

Set oOL = New Outlook.Application
Set oSelection = oOL.ActiveExplorer.Selection
Set fs = CreateObject("Scripting.FileSystemObject")

vPath = "c:\Attachments_Outlook\"
If Not fs.FolderExists(vPath) Then fs.CreateFolder vPath

vSubject = "Attachments from: ---"
vHTMLBody = "<HTML>"

For Each obj In oSelection
vSubject = vSubject & """" & obj.Subject & """---"
For Each Attachment In obj.Attachments
Attachment.SaveAsFile (vPath & Attachment.FileName)
vHTMLBody = vHTMLBody & "<FONT face=Arial size=3>" & _
Attachment.FileName & "</Font><br>" & _
"<IMG alt="""" hspace=0 src=""" & vPath & Attachment.FileName & _
""" align=baseline border=0><br><br><br>"
Next
Next

Set objMsg = oOL.CreateItem(0)
With objMsg
.Subject = vSubject
.HTMLBody = vHTMLBody & "</HTML>"
.Display
DoEvents
End With

For Each obj In oSelection
For Each Attachment In obj.Attachments
fs.DeleteFile (vPath & Attachment.FileName)
Next
Next

Set fs = Nothing
Set objMsg = Nothing
Set oSelection = Nothing
Set oOL = Nothing
End Sub
 
Back
Top