Dim help needed

  • Thread starter Thread starter Rick Brown
  • Start date Start date
R

Rick Brown

I'm having trouble setting the dim statements needed to run the below
code.
I want to loop thru a specific folder of multiple Emails with multiple
attachments and save attachments as files on the harddrive so I can
open and print the file, all via VBA.
I'm new to the Outlook model and the book I bought and any online help
is sketchy in this area.

Set myItem = myOlApp.ActiveInspector.CurrentItem
Set myAttachments = myItem.Attachments
myAttachments.Item(1).SaveAsFile "C:\My Documents\" & _
myAttachments.Item(1).DisplayName

Any help would be appreciated, RICK
 
These look like they'd be the Dims you're after. Though I can't guarantee the code will work as I am using Outlook 2000, which doesn't seem to support all the object members called below.

Dim myOlApp As Outlook.Application
Dim myAttachments As Attachments
Dim myItem As MailItem

regards,

Selgin
----- Rick Brown wrote: -----

I'm having trouble setting the dim statements needed to run the below
code.
I want to loop thru a specific folder of multiple Emails with multiple
attachments and save attachments as files on the harddrive so I can
open and print the file, all via VBA.
I'm new to the Outlook model and the book I bought and any online help
is sketchy in this area.

Set myItem = myOlApp.ActiveInspector.CurrentItem
Set myAttachments = myItem.Attachments
myAttachments.Item(1).SaveAsFile "C:\My Documents\" & _
myAttachments.Item(1).DisplayName

Any help would be appreciated, RICK
 
Back
Top