Saving Outlook Attachment (1 Viewer)

Isaac

Lifelong Learner
Local time
Today, 02:29
Joined
Mar 14, 2017
Messages
8,738
The code on that page is fairly portable to be run in any Office program that supports VBA. You could run that from Access, Word, Excel, or Outlook itself. You might need to make some tiny adjustments, depending on which host you need.

How exactly do you want to trigger it, if you also want to avoid any host program being open when it runs?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 02:29
Joined
Oct 29, 2018
Messages
21,357
Hi. That code doesn't even mention Access, so I am not sure why you thought Access had to be open?
 

jo15765

Registered User.
Local time
Today, 02:29
Joined
Jun 24, 2011
Messages
130
Hi. That code doesn't even mention Access, so I am not sure why you thought Access had to be open?

the code is vba, I would adapt it to run via access vba - but I know from previous experience you can't have an access macro run if the access db is not open which lead to my ?
 

jo15765

Registered User.
Local time
Today, 02:29
Joined
Jun 24, 2011
Messages
130
The code on that page is fairly portable to be run in any Office program that supports VBA. You could run that from Access, Word, Excel, or Outlook itself. You might need to make some tiny adjustments, depending on which host you need.

How exactly do you want to trigger it, if you also want to avoid any host program being open when it runs?

Yes, the code is VBA, I'd adapt it to access vba to execute. My question, you are correct is how could I trigger it w/o access being open?

Altho, that makes the mind wonder, if I could adapt that to a vbscript. hmmmm...amazing what the mind can think of with just a few simple bits of assistance
 

theDBguy

I’m here to help
Staff member
Local time
Today, 02:29
Joined
Oct 29, 2018
Messages
21,357
the code is vba, I would adapt it to run via access vba - but I know from previous experience you can't have an access macro run if the access db is not open which lead to my ?
Hi. Thanks for trying to clarify your question/intention. The sample code you referenced uses Excel VBA, so Access doesn't have to be open when you run it. However, Excel has to be open though. So, if you're planning to use Access VBA instead of Excel, then Access has to be open. If you don't want Access to be open, then you'll have to use something else than Access. Like you said, VBScript can do it. However, whichever you use, Outlook will have to be open anyway, then perhaps just use Outlook VBA, and you won't need anything else to be open.
 

Isaac

Lifelong Learner
Local time
Today, 02:29
Joined
Mar 14, 2017
Messages
8,738
Yes, the code is VBA, I'd adapt it to access vba to execute. My question, you are correct is how could I trigger it w/o access being open?

Altho, that makes the mind wonder, if I could adapt that to a vbscript. hmmmm...amazing what the mind can think of with just a few simple bits of assistance
You read my mind.
The first point I am trying to make is, while dbGuy is right of course, Ron's webpages (that one included) are targeted toward Excel, yet that code is almost 100% relevant to the Outlook object model, and can be ported to any Office program with extremely minimal adjustments, if any.

The next point I was going to make, which you have now stated, is.....it sounds like VBScript might be a solution for you. I have written many VBScripts which essentially execute against VBA object models, in cases where I don't want to cause an actual Office program to open in a typical, visible, user-interactive manner. If you are somewhat familiar with VBScript and are comfortable using its syntax along with late-binding the Office automation, that's probably your solution. Be aware that this will still mean the Office program you are referencing in your VBScript still needs to be installed on the host user's machine. But the advantage of the VBScript--which I assume is the advantage you are after--is the triggering aspect, you will gain the advantage that to trigger this code, Outlook does not need to be open and the script can be called from virtually any context you can think of, stealth mode, so to speak.

I'd probably just double check that the code you have contains no references to Excel (eliminate them if it does), and then go with VBScript & Outlook automation.
 

Users who are viewing this thread

Top Bottom