Anne Troy
asked on
Outlook 2007. Save attachment 2 times. Once to specific location, again to user-designated folder.
I want to open an email and run a macro (from ribbon is fine--I got that part).
I want to be prompted for a 4-digit number. The number gets punched in (example: 6677)
I want the macro to save the *.LIC file to:
\\MyBigFolder\MyLittleFold er\6677
(where 6677 is the 4-digit number entered by user, and it looks like we'll need 5 digits before you know it)
And to ALSO save it, without user intervention, to the folder named:
\\192.168.100.9\pas\Hospit al Licenses
That would be incredible. :)
I could probably figure out the 2nd save using the first-save code.
I want to be prompted for a 4-digit number. The number gets punched in (example: 6677)
I want the macro to save the *.LIC file to:
\\MyBigFolder\MyLittleFold
(where 6677 is the 4-digit number entered by user, and it looks like we'll need 5 digits before you know it)
And to ALSO save it, without user intervention, to the folder named:
\\192.168.100.9\pas\Hospit
That would be incredible. :)
I could probably figure out the 2nd save using the first-save code.
ASKER
Can't wait to try it, Chris! Leaving for work now.
ASKER
Apparently, Outlook macros that contain something in the parentheses aren't available to run? (I have looked and looked to find why, and can't.)
Sub savetwo(mai As Object)
Must become
Sub savetwo()
So, of course, I try to run it like that and get the abort loop error.
Sub savetwo(mai As Object)
Must become
Sub savetwo()
So, of course, I try to run it like that and get the abort loop error.
Apologies I didn't define the calling mechanism ... I made it a parameter to allow the sub to be used from both code and a rule. Therefore re-instate the parameter then call for example as:
savetwo application.activeexplorer .selection (1)
assuming an item is selected in the explorer window.
Chris
savetwo application.activeexplorer
assuming an item is selected in the explorer window.
Chris
ASKER
"an item is selected"
You mean a message? I'm not in Explorer, I am in Outlook saving an attachment.
You mean a message? I'm not in Explorer, I am in Outlook saving an attachment.
The outlook activeexplorer is a reference to the folder in outlooks folder pane where the current item is selected
Replacing:
savetwo application.activeexplorer .selection (1)
with
savetwo application.activeinspecto r.currenti tem
To work with the last opened outlook item
Chris
Replacing:
savetwo application.activeexplorer
with
savetwo application.activeinspecto
To work with the last opened outlook item
Chris
ASKER
Okay, it's prompting for the number now. Phew!
I don't need it to create the folder if it doesn't exist. If it doesn't exist, it's a bad folder number. Could I have it throw an error "Folder doesn't exist" with an OK button? I have no idea what all parts of the code to remove.
Thanks so much!!
I don't need it to create the folder if it doesn't exist. If it doesn't exist, it's a bad folder number. Could I have it throw an error "Folder doesn't exist" with an OK button? I have no idea what all parts of the code to remove.
Thanks so much!!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I'm sure this will work, I simply haven't had a chance to try it out. Thanks, Chris, for all your help!
Open in new window
Chris