Hmm... can see how to easily do everything you want, except open the attachement part.
I have a somewhat simular macro that works with Groupwise email... it first checks 4 pixel locations to see if there are attachments, then if there are it saves those to a specific directory while remembering the files names for use later in macro, at which point it add's those files into a form that the macro is designed to complete for me.
Here's a copy of that section of my macro.. maybe you'll get some inspiration from it:
Macro Playback Speed: 3 Times Faster than Normal
Audio Mute
Window Resize: Current Win - (Width: 551, Height: 417)
Get Pixel: Window Coords: 115,325 into %N3%
Get Pixel: Window Coords: 190,325 into %N4%
Get Pixel: Window Coords: 265,325 into %N5%
Get Pixel: Window Coords: 340,325 into %N6%
If Variable %N3% <> 16777215
Mouse Move Window 115, 325
Mouse Right Button Click
Delay 1 Seconds
Text Type: s
Delay 1 Seconds
Clipboard Copy
Variable Set String %T11% "c:\macrotemp\"
Variable Set String %T12% from Clipboard
Variable Modify String: Append %T12% to %T11%
Delay 1 Seconds
Text Type: %T11%
Delay 0.5 Seconds
Text Type: <ENTER>
Text Type: y
Wait for Not Mouse Cursor: Hour Glass
Delay 0.5 Seconds
Variable Set String %T12% "%T11%"
Else
End If
If Variable %N4% <> 16777215
Mouse Move Window 190, 325
Mouse Right Button Click
Delay 1 Seconds
Text Type: s
Delay 1 Seconds
Clipboard Copy
Variable Set String %T11% "c:\macrotemp\"
Variable Set String %T13% from Clipboard
Variable Modify String: Append %T13% to %T11%
Delay 1 Seconds
Text Type: %T11%
Delay 0.5 Seconds
Text Type: <ENTER>
Text Type: y
Wait for Not Mouse Cursor: Hour Glass
Delay 0.5 Seconds
Variable Set String %T13% "%T11%"
Else
End If
If Variable %N5% <> 16777215
Mouse Move Window 265, 325
Mouse Right Button Click
Delay 1 Seconds
Text Type: s
Delay 1 Seconds
Clipboard Copy
Variable Set String %T11% "c:\macrotemp\"
Variable Set String %T14% from Clipboard
Variable Modify String: Append %T14% to %T11%
Delay 1 Seconds
Text Type: %T11%
Delay 0.5 Seconds
Text Type: <ENTER>
Text Type: y
Wait for Not Mouse Cursor: Hour Glass
Delay 0.5 Seconds
Variable Set String %T14% "%T11%"
Else
End If
If Variable %N6% <> 16777215
Mouse Move Window 340, 325
Mouse Right Button Click
Delay 1 Seconds
Text Type: s
Delay 1 Seconds
Clipboard Copy
Variable Set String %T11% "c:\macrotemp\"
Variable Set String %T15% from Clipboard
Variable Modify String: Append %T15% to %T11%
Delay 1 Seconds
Text Type: %T11%
Delay 0.5 Seconds
Text Type: <ENTER>
Text Type: y
Wait for Not Mouse Cursor: Hour Glass
Delay 0.5 Seconds
Variable Set String %T15% "%T11%"
Else
End If