Welcome to Office Zealot Sign in | Join | Help

A Better Way To View Multiple Picture Attachments

NOTE:
Due to data loss with OfficeZealot's blog server, all comments posted between April 28 and June 8, 2005  to any of my blog entries were inadvertently deleted.  The end of this blog entry contains the text of the comments applicable to this posting that I was able to recover.

ANOTHER UPDATE:  The content of this article is superceded by a newer version with more features, outlined in this article on MSDN:

Office Developer Center: Viewing Multiple Picture Attachments in Outlook 2003:
http://msdn.microsoft.com/office/default.aspx?pull=/library/en-us/odc_ol2003_ta/html/Office_Outlook_ViewMultPictAttach.asp

UPDATE: The information in this post is really intended for those of you who have some decent experience programming within the Outlook VBA Editor.  I never meant for this to be consumed by general users, so if you don't know how to set references to Type Libraries, create User Forms or compile and debug VBA, then you know you are not the intended audience.  I may redo this solution as a downloadable, installable COM Add-In sometime - for use by ALL Outlook users - so stay tuned...

This is one of my most heavily used weapons in my Outlook macro arsenal, and saves me a lot of grief. Take a look at the screenshot below:

Message Attachments Screenshot

Doesn't this drive you nuts? You can select all of the attachments in an e-mail, but you can't launch all of them at the same time. You have to double-click each one individually. I'm sure there's been many times when you've received an e-mail from one of your friends with 15 joke pictures, or Aunt Rose sends you 5 photos of her new cat, and it quickly becomes a real chore to open - view - close every single attachment.

Read on, and I'll show you the code for a much better way to handle this.

The Message Attachments Form

Ultimately, this is what you will see when you click a custom button on one of your toolbars:

 Custom Form Screenshot

This form will contain a list of all the picture attachments in the current message (those with .gif, .jpg, .tif or .bmp extensions; you can enter additional ones in the frmAttachments.FillList procedure). You can selectively choose non-contiguous entries in the list with Shift-clicks, all entries, just one attachment (double-clicks are enabled), and then click a button to show the picture(s).

Launching the Message Attachments Form

First off, to launch this form, create this macro and put it either in your ThisOutlookSession module or any Modules you have in your VBA Project:

Sub ViewAttachments()
On Error GoTo EH:

    Dim objMessage As Object

    Set objMessage = Application.ActiveInspector
    If objMessage.CurrentItem.Attachments.Count = 0 Then Exit Sub
    Set frmAttachments.objMessage = objMessage.CurrentItem
    frmAttachments.FillList
    frmAttachments.Show

EH:
    If Err.Number <> 0 Then
        MsgBox "Something is wrong!"
        Exit Sub
    End If
End Sub

You'll also need to create a custom button on one of your message Toolbars. To do this, choose Customize from the Toolbars sub-menu under the View menu of your message. Click the Commands tab, choose Macros from the Categories list, and select OutlookVBA.ViewAttachments. Now drag that to a spot on any of your Toolbars and you're good to go.

Message Attachments Form Code

Here is the code for the frmAttachments UserForm. Rather than recreating the UserForm yourself, you can download the file to save yourself some trouble. I'll include the code here for reference anyway:

Option Explicit
Public objMessage As MailItem
Dim objFs As New Scripting.FileSystemObject
Dim objTempFolder As Scripting.Folder
Dim strTempFolderPath As String
Dim strTempFilesUsed() As String
Dim lngTempFileCount As Long
Const ImageViewerFilePath As String = """C:\Program Files\Internet Explorer\iexplore.exe """
'ALTERNATELY, IF YOU HAVE Office XP's Photo Editor INSTALLED, USE THAT AS IT IS FAST AND SUPPORTS
'MULTIPLE IMAGE WINDOWS; LOOK FOR C:\Program Files\Common Files\Microsoft Shared\PhotoEd\PHOTOED.EXE
'OR YOU CAN USE WHATEVER IMAGE VIEWER YOU WANT, AS LONG AS IT CAN TAKE ONE FILE NAME AS AN ARGUMENT
'FROM THE COMMAND LINE OR RUN DIALOG

Sub FillList()
    'PRE-POPULATE THE LIST BOX WITH PICTURE ATTACHMENT FILE NAMES
    Dim objAtt As Attachment, objAtts As Attachments
 
    Set objAtts = objMessage.Attachments
    lstAtts.Clear
    For Each objAtt In objAtts
        Select Case Right(objAtt.FileName, 3)
            Case "jpg", "gif", "tif", "bmp", "JPG", "GIF", "TIF", "BMP"
                Me.lstAtts.AddItem objAtt.Index
                Me.lstAtts.List(lstAtts.ListCount - 1, 1) = objAtt.FileName
        End Select
    Next
End Sub

Private Sub cmdClose_Click()
    Unload Me
End Sub

Private Sub cmdOpen_Click()
On Error GoTo EH:

    Dim strFileName As String
    Dim intX As Integer, varRet As Variant

    If lstAtts.ListIndex = -1 Then Exit Sub

    'LOOP THROUGH SELECTED PICTURE ATTACHMENTS
    For intX = 0 To lstAtts.ListCount - 1
        If lstAtts.Selected(intX) = True Then
            strFileName = strTempFolderPath & "\" & objMessage.Attachments.Item(lstAtts.List(intX, 0)).DisplayName
            objMessage.Attachments.Item(lstAtts.List(intX, 0)).SaveAsFile strFileName
            ReDim Preserve strTempFilesUsed(lngTempFileCount)
            strTempFilesUsed(lngTempFileCount) = strFileName
            lngTempFileCount = lngTempFileCount + 1                       

            'LAUNCH IMAGES IN DEFINED IMAGE VIEWER
            varRet = Shell(ImageViewerFilePath & " " & """" & strFileName & """", 1)
        End If
    Next

EH:
    If Err.Number <> 0 Then
        MsgBox Err.Number & vbCrLf & Err.Description & vbCrLf & vbCrLf & "[error in cmdOpen_Click]", vbOKOnly + vbExclamation, "ERROR"
        Exit Sub
    End If
End Sub

Private Sub cmdOpenAll_Click()
On Error GoTo EH:

    Dim strFileName As String
    Dim intX As Integer, varRet As Variant

    If Me.lstAtts.ListCount <= 0 Then Exit Sub

    'LOOP THROUGH ALL PICTURE ATTACHMENTS
    For intX = 0 To lstAtts.ListCount - 1
        strFileName = strTempFolderPath & "\" & objMessage.Attachments.Item(lstAtts.List(intX, 0)).DisplayName
        objMessage.Attachments.Item(lstAtts.List(intX, 0)).SaveAsFile strFileName
        ReDim Preserve strTempFilesUsed(lngTempFileCount)
        strTempFilesUsed(lngTempFileCount) = strFileName
        lngTempFileCount = lngTempFileCount + 1

        'LAUNCH IMAGES IN DEFINED IMAGE VIEWER
        varRet = Shell(ImageViewerFilePath & " " & """" & strFileName & """", 1)
    Next

EH:
    If Err.Number <> 0 Then
        MsgBox Err.Number & vbCrLf & Err.Description & vbCrLf & vbCrLf & "[error in cmdOpenAll_Click]", vbOKOnly + vbExclamation, "ERROR"
        Exit Sub
    End If
End Sub

Private Sub lstAtts_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
    cmdOpen_Click
End Sub

Private Sub UserForm_Activate()
    GetTempFolder
End Sub

Private Sub UserForm_Terminate()
    DeleteTempFiles
    Set objMessage = Nothing
    Set objFs = Nothing
    Set objTempFolder = Nothing
End Sub

Sub DeleteTempFiles()
On Error GoTo EH:

    Dim objFile As Scripting.File
    Dim intX As Integer   

    For intX = 0 To UBound(strTempFilesUsed)
        Set objFile = objFs.GetFile(strTempFilesUsed(intX))
        objFile.Delete True
    Next

EH:
    If Err.Number <> 0 Then
        If Err.Number = 9 Then Exit Sub 'strTempFilesUsed ARRAY IS EMPTY; NO FILES WERE OPENED
        If Err.Number = 53 Then Resume Next 'FILE NOT FOUND; MAY HAVE GOT DELETED ALREADY IF THE SAME FILE WAS
        'OPENED MORE THAN ONCE, AS THE FILE NAME WOULD HAVE BEEN DUPLICATED IN THE ARRAY WE ARE PARSING
        MsgBox Err.Number & vbCrLf & Err.Description & vbCrLf & vbCrLf & "[error in DeleteTempFiles]", vbOKOnly + vbExclamation, "ERROR"
        Exit Sub
    End If
End Sub

Sub GetTempFolder()
On Error Resume Next

    Dim objTempFolder As Scripting.Folder   

    'GET THE TEMP FOLDER
    Set objTempFolder = objFs.GetSpecialFolder(2) 'path is found in the TMP environment variable
    If objFs.FolderExists(objTempFolder & "\AttachmentsTemp") = False Then
        Set objTempFolder = objFs.CreateFolder(objTempFolder & "\AttachmentsTemp")
    Else
        Set objTempFolder = objFs.GetFolder(objTempFolder & "\AttachmentsTemp")
    End If
    If Err.Number <> 0 Then
        'UNABLE TO RETRIEVE TEMP FOLDER
        'YOU MAY WANT TO HARDCODE A FOLDER HERE THAT WILL WORK ON YOUR SYSTEM
        strTempFolderPath = "C:\Temp"
 
        If objFs.FolderExists(strTempFolderPath) = False Then
            objFs.CreateFolder strTempFolderPath
        End If

        Set objTempFolder = objFs.GetFolder(strTempFolderPath)
    Else
        strTempFolderPath = objTempFolder.Path
    End If

End Sub

Final Comments

You might notice that I'm using Internet Explorer to launch the images. I can't assume what you are using as the default image viewer on your PC, but IE is always there (!) so I chose that. Feel free to change the viewer to whatever you like. See the inline comments in the code for more information. Have fun using this! I hope it makes your life easier when working with multiple picture attachments.

----------------------------------------------------------------
COMMENTS RESTORED FROM BACKUP:


Sun 6/5/2005 11:40 PM Jimmy

"Hi Eric .. I get a compilation error for the line "objFs As New Scripting.FileSystemObject". It says "User defined type not defined". Please help!

Jimmy"

Mon 6/6/2005 1:15 AM Jimmy

""90
Object variable or with block variable not set

[error in cmdOpen_Click]
"
This is the error I got while trying to open any picture attachment. Anyone got that problem?"


Mon 6/6/2005 6:50 PM Jimmy

"Thanks for that Mate, now I got this runtime error
"91
Object variable or with block variable not set

[error in cmdOpen_Click]
"
This is the error I got while trying to open any picture attachment. Anyone got that problem? "

END COMMENTS RESTORE
----------------------------------------------------------------

Published Thursday, January 29, 2004 12:20 PM by legault
Filed under: ,

Comments

#

How about just launching whatever the registered application is for the file type? This would make the code much more portable. 'used for shelling out to the default application associated with the file Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long Public Const conSwNormal = 1 ShellExecute hwnd, "open", strFileNamePath, vbNullString, vbNullString, conSwNormal
Thursday, January 29, 2004 12:52 PM by Anonymous

#

That is definitely an option, Mike. The reason why I didn't go with that approach is because of Windows XP. The average user on this OS may not have a third-party image viewer, and would be using the default Windows Picture and Fax Viewer. This application does not support launching images in multiple windows.
Thursday, January 29, 2004 1:21 PM by Anonymous

#

So, when will you be distributing this at the office?
Thursday, January 29, 2004 1:59 PM by Anonymous

#

Thanks for this...Very practical enhancement. I think this should be built in office by default. Roll on version 12!
Friday, January 30, 2004 4:00 PM by Anonymous

#

Hey guys, great idea... here?s a few side notes, you can use CreateObject to get at ie, also might want to add LCase or UCase to your extension checking. I also thought it might be better if you just click the email and run the macro, no need to have to go into the actual email. This way you can now select multiple emails as well! Also when working with ie and outlook, ie tends to be a little flaky and crashes at times, so added a delay to handle that, seems ie is busy grabbing images and images are deleted before ie has a chance to snatch them up... Well i was going post the code below, but not formating right.. you can view the code here: http://miguelcarrasco.blogspot.com
Friday, February 06, 2004 8:11 PM by Anonymous

#

Thank you for your work. I have made a mess...I have never created a macro and thought if I downloaded the file and followed your instructions I would be able to do it. First of all I draged the button to the top menu (file, edit, view ect)and can't remove it following Outlook help instructions. The button is huge with the full name (I called it picviewer and the button includes that and Vbaproject.otm)It wouldn't be to bad if it worked but the Visual Basic debugger keeps coming up when I click on the button and I don't know how to debug it.I don't know how to delete it all and start over or how to get it to work. I found your site from a Google search and yours was the only solution to the picture viewing hassel in Outlook I could find. Could you please give me some direction on how to get it to work or tell me how to get rid of what I've done. Thanks, Duane
Tuesday, April 27, 2004 8:29 PM by Anonymous

#

Hi Duane. You can get rid of the custom menu you made by right-clicking on the Toolbar and choosing "Customize". Now you can right-click the menu you created and select "Delete". Duane, my blog is really meant for developers. I never imagined someone who isn't a programmer or familiar with Outlook macros to use my code or set this up. However, all you really need to do is import the frmAttachments.frm file within the Outlook Visual Basic Editor. That is the most important step. To do this, open the VBA Editor (ALT+F11), and choose "Import File" from the "File Menu". Then browse to the frmAttachments.frm file you downloaded. Now you can create the custom toolbar as described. If you have any problems, let me know.
Tuesday, April 27, 2004 10:17 PM by legault

#

Hi Eric, Did you recieve my hotmail reply with the screenshot zip file? If I had hair I would have pulled it out by now :-0.I know I have waded into water I can't swim in but I'm wet now so could you throw me a preserver and explain to me in "dummies" terms on how to get rid of that button and how, step by step, I can get this thing to work. I really like what you have done and want to get it to work. If need be I can uninstall Outlook and start over but I don't know if that is nessesary yet.I guess I could just go back to OE but I want to be able to use the other features of Outlook. Thanks again and sorry for being a pain in the ass. Duane
Wednesday, April 28, 2004 9:50 PM by Anonymous

#

Eric, I'm real excited to get the multiple open macro running but I have a problem in that the compiler is telling me that I need to define the the user defined types in your program. Lines 3 thru 7 in your code. I'm not a VB programmer-can you assist. Thanks John
Thursday, May 06, 2004 7:42 PM by Anonymous

#

Eric, My son-in-law figured out my problem. I had to start Microsoft Scripting Runtime. Your code is working great now. Thank you so much for this much needed enhancement to Outlook 2002. John
Friday, May 07, 2004 3:13 PM by Anonymous

#

Why OE can view the multiple images straight in the message body without any problem or coding needed. Any idea?
Wednesday, May 12, 2004 2:46 AM by Anonymous

#

The code you write works fine, thanks!! Gregor
Thursday, May 20, 2004 6:02 AM by Anonymous

#

Thanks for a useful utility, Instead of using multiple IE or photo editor why not just browse the folder with the extracted pics using windows explorer? Once you configured WE to use filmstrip this is very convenient.
Friday, June 18, 2004 5:11 PM by Anonymous

#

Sure, that's an option too if you prefer that method. However, my way saves you the pain of saving the attachments and deleting them when you're done! A lot of pictures I get in e-mails I don't keep anyway, and previewing all of them from within the message saves a few clicks.
Sunday, June 20, 2004 10:00 PM by legault

#

Hi Eric, "....Click the Commands tab, choose Macros from the Categories list, and select OutlookVBA.ViewAttachments. Now drag that to a spot on any of your Toolbars and you're good to go." I tried to follow your instructions but I don't see the OutlookVBA.ViewAttachments when I select Macros from the categories list. Have I missed a step somewhere? Stephen.
Wednesday, June 23, 2004 2:45 AM by Anonymous

#

The only way this could happen is if you didn't paste the ViewAttachments procedure code into your Outlook VBA Project. Do you see other macros in that list?
Wednesday, June 23, 2004 9:01 AM by legault

#

Hi Eric, Many thanks for your early response as I'm very keen to get this working. I followed the instructions "To do this, open the VBA Editor (ALT+F11), and choose "Import File" from the "File Menu". Then browse to the frmAttachments.frm file you downloaded." Once imported. The .FRM file which I imported shows up under FORMS in VBA Editor. I then exited out of VBA Editor and moved on to creating the custom toolbar as described. However, I don't see any other macros on the list. Would you kindly explain what you meant by pasting the ViewAttachments procedure code into my outlook VBA project?
Wednesday, June 23, 2004 8:12 PM by Anonymous

#

Okay, I see what the problem is. Open up the VBA Editor, click "Project Explorer" from the "View" Menu, and double-click ThisOutlookSession in the tree. This should open up that module, and you can paste the ViewAttachments procedure in there. Note that the macro in the toolbar customization dialog may be named "Project1.ThisOutlookSession.ViewAttachments"; you can't scroll horizontally there so it may be somewhat hidden.
Thursday, June 24, 2004 9:27 AM by Anonymous

# re: A Better Way To View Multiple Picture Attachments

Thanks for writing this. I was about to switch back to Outlook Express until I found your Blog during a search for Outlook addons. I had never worked with VBA Editor before, but now I may try some more. Thanks again, it works great.
Friday, August 06, 2004 2:37 PM by Anonymous

# re: A Better Way To View Multiple Picture Attachments

Hi, I have a error meesage that the "Scripting" is not a defined object.
How can I do? Thanks....
Friday, August 06, 2004 7:49 PM by Anonymous

# re: A Better Way To View Multiple Picture Attachments

Khmer - it sounds like you need to set a reference to the Microsoft Scripting Runtime library in the References dialog within the VBA Editor.
Saturday, August 07, 2004 11:31 PM by legault

# re: A Better Way To View Multiple Picture Attachments

Ran into all the bugs listed here and fixed them. Now with everything in place and the macro running, I get an error "Something is Wrong" - any suggestions?
Sunday, August 22, 2004 12:31 PM by Anonymous

# re: A Better Way To View Multiple Picture Attachments

Toby - I'm guessing that maybe it is not an e-mail message that has the attachment, but something like a Post, Task, Appointment, etc. Yeah, I know, I should have coded for that possibility (however unlikely)...
Sunday, August 22, 2004 9:35 PM by legault

# re: A Better Way To View Multiple Picture Attachments

I just figured it out - the macro doesn't work in the reading pane - the message actually has to be opened. You know any way around this? Thanks for your great work btw - this is awesome!
Sunday, August 22, 2004 10:42 PM by Anonymous

# re: A Better Way To View Multiple Picture Attachments

Toby - the macro is meant to be fired from the e-mail message window. It is not too difficult to add some code to handle the Explorer.Selection property to do the same thing from a folder view. Go nuts!
Monday, August 23, 2004 7:52 AM by legault

# re: A Better Way To View Multiple Picture Attachments

Thanks, I happened to find this doing a search - works great.
Wednesday, October 20, 2004 1:24 PM by Anonymous

# Putting it all together...

Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Public Const conSwNormal = 1


Sub ViewPictures()
'1. Uses winows file explorer instead of internet explorer for thumbnails
'2. Launches default viewer for first picture in message(s)
'3. Faster and more friendly to very large/small images
'4. Thank you for having this site and all of your ideas

Dim outlookApplication As Outlook.Application
Dim outlookSelection As Outlook.Selection
Dim fileSystem As Object
Dim hwnd As Long

Dim imagesFound As Boolean
Dim tempPath As String
Dim firstFile As String

Set outlookApplication = New Outlook.Application
Set outlookSelection = outlookApplication.ActiveExplorer.Selection
Set fileSystem = CreateObject("Scripting.FileSystemObject")

tempPath = "c:\tempImages\"

If Not fileSystem.FolderExists(tempPath) Then
fileSystem.CreateFolder (tempPath)
Else
'clean up from last time
fileSystem.DeleteFile tempPath & "*.*"
End If

firstFile = ""
imagesFound = False
For Each obj In outlookSelection
For Each Attachment In obj.Attachments
Select Case LCase(Right(Attachment.FileName, 3))
Case "jpg", "gif", "tif", "bmp"
If firstFile = "" Then
firstFile = tempPath & Attachment.FileName
End If
Attachment.SaveAsFile (tempPath & Attachment.FileName)
imagesFound = True
End Select
Next
Next

If imagesFound Then
'Open thumbnails in windows explorer
Call Shell("explorer " & Chr(34) & tempPath & Chr(34), vbNormalFocus)
'Start default picture viewer
ShellExecute hwnd, "open", firstFile, vbNullString, vbNullString, conSwNormal
Else
MsgBox "No images in selected message(s)"
End If


Set fileSystem = Nothing
Set outlookSelection = Nothing
Set outlookApplication = Nothing

End Sub
Saturday, October 23, 2004 1:59 AM by Anonymous

# re: A Better Way To View Multiple Picture Attachments

Eric, Your code worked great, but i think i like the idea of opening the pictures in thumbnail or filmstrip, but i dont really understand Nick's post. Have you tried his variation? If so can you explain it the way you explained your code.
Monday, November 01, 2004 9:59 AM by Anonymous

# re: A Better Way To View Multiple Picture Attachments

HEB: It looks like Nick's code saves the attachments to the C:\tempimages folder, then launches Windows Explorer to display the files and opens the first file using the default image viewer. I couldn't get his code to work because he is missing some variable declarations (especially the ShellExecute Win32API function) and I don't really feel like playing with it.

I would love to add functionality to display the images in thumbnail mode on the form, but I can't find a free ActiveX control to do that.

BTW, stay tuned to the MSDN Outlook Developer Center, as in the next month I will have an advanced version of this code published as an article with some new features.
Monday, November 01, 2004 10:19 AM by legault

# re: A Better Way To View Multiple Picture Attachments

Awesome code. Thanks to all these posts above I don't have to bother you for help! I've created macros for excel and word, but never for outlook. Do you think it's possible to have all the pictures open in one IE window, so then you could use the back/forward button to see all the pictures? I'm going to try and play with this, but if you have already spent alot of time with no success, please tell, so I don't waste mine. Thanks again.
Sunday, November 07, 2004 5:55 PM by Anonymous

# re: A Better Way To View Multiple Picture Attachments

Outlook Picture Viewer allows you to click on just one picture, and then use your existing viewer to automatically scroll through the other pictures one by one.
Sunday, November 07, 2004 9:52 PM by Anonymous

# re: A Better Way To View Multiple Picture Attachments

Kevin: what you want to do is not possible. The forward and back buttons in IE are only useful for navigating between pages that have already been viewed. An alternative is to use a tabbed browser like Firefox or Maxthon for the image viewer.
Monday, November 08, 2004 8:16 AM by legault

# re: A Better Way To View Multiple Picture Attachments

John: neat! I'm going to have to try this out. It looks like it forces you to change your default image viewer though, which is pretty underhanded.
Monday, November 08, 2004 8:17 AM by legault

# re: A Better Way To View Multiple Picture Attachments

How can I handle events a I click on a button in the toolbat such as open or save ?
Wednesday, December 22, 2004 10:26 AM by Anonymous

# re: A Better Way To View Multiple Picture Attachments

You would have to set a global variable for a CommandBarButton object declared With Events. Then you can access the Click event for that button.

See this link for a good sample of programming with toolbars and buttons in Outlook and Office:

http://www.microeye.com/resources/itemsCB.htm
Wednesday, December 22, 2004 10:49 AM by legault

# re: A Better Way To View Multiple Picture Attachments

Hi Eric,

Thanks so much for this code and it is great. Howwever I too is having the same problem as Jimmy got on 06/06/2005. which is,

"91
Object variable or with block variable not set

[error in cmdOpen_Click]
"


I'm using outlook 2000. Please help me to solve this problem

Many thanks
Malika
Friday, July 01, 2005 6:58 PM by Anonymous

# re: A Better Way To View Multiple Picture Attachments

Malika: This problem has me stumped! Could you set a breakpoint on the "Private Sub cmdOpen_Click()" line and step through the code? Let me know which is the last line that executes before it hits the error handler.
Monday, July 04, 2005 11:50 AM by legault

# re: A Better Way To View Multiple Picture Attachments

I have found someone who finds this constraint as irritating as I do!

Not an advanced user so look forward to the exe version when you get it done to get!

Thanks for confirming it is not just an option I could not find.
Sunday, July 31, 2005 8:23 PM by Anonymous

# re: A Better Way To View Multiple Picture Attachments

im getting the "object variable or with block variable not set" error in OL 2003 also.

i have seen it before and had to work around it... it would be great to see a fix!

Alex
Thursday, August 11, 2005 6:39 AM by Anonymous

# re: A Better Way To View Multiple Picture Attachments

Alex: I'm still stumped and cannot replicate this error. Can you set a breakpoint on that line and do some judicious debugging to help me figure out what coulde be wrong?
Thursday, August 11, 2005 10:55 AM by legault

# re: A Better Way To View Multiple Picture Attachments

hey eric, the line it is giving the error "object variable or with block variable not set" is this :
"If objMessage.CurrentItem.Attachments.Count = 0 Then"

the problem is that the line before this i.e. "Set objMessage = Application.ActiveInspector", sets objMessage to "Nothing" ! can u think of a way aroung this problem? any help would be appreciated thanx mate !
Sunday, August 28, 2005 1:23 PM by Anonymous

# re: A Better Way To View Multiple Picture Attachments

Aditya: The error is most likely due to the fact that you are calling the macro from the main Outlook window without an open e-mail. You must either call it from an open e-mail manually or map a macro to a custom button on the e-mail form.
Monday, August 29, 2005 9:38 AM by legault

# re: A Better Way To View Multiple Picture Attachments

thank you
Wednesday, August 31, 2005 11:04 AM by Anonymous

# re: A Better Way To View Multiple Picture Attachments

Thanks Nick - that worked first time for me!!
Tuesday, October 25, 2005 6:30 PM by Anonymous

# re: A Better Way To View Multiple Picture Attachments

Thank you for your help. I'll pass the info on to my computer-wiz son, who no doubt will find the info a great guide toward helping me! Much appreciated.
Saturday, March 04, 2006 4:16 PM by Anonymous

# re: A Better Way To View Multiple Picture Attachments

I am too stupid to do this.
Thursday, September 07, 2006 5:39 PM by Anonymous
Anonymous comments are disabled