PDA

View Full Version : Solved: rename and save as file after arriving mail



danovkos
09-08-2009, 01:11 AM
Hi all,
pls. how can i do following.
I want after arriving mail run script/code, which will only save and rename file from path1:
C:\folder\white.xls

to new folder
path2:
c:\destination\black.xls

this file is not attached in mail. It is saved on path1 and i want to save it to path2.
I hope is it not to hard make it but i am newbe in outlook vba ...
OR BETTER. HOW CAN DEFINE TO LAUNCH FILE. IT IS TYPE AUTOIT (AU3). THE APPLICATION IS AUTOIT.EXE.
I TRIED THIS, BUT IT DOESNT WORKS:

Shell "C:\Documents and Settings\docs\programs\autoit3\AutoIt3.exe" & "C:\Documents and Settings\docs\programs\autoit3\runA3\TEST.au3"

pls. how can i do this?
thx

JP2112
09-08-2009, 01:43 PM
To launch any associated file from VBA, try this:

Dim myShell As Object
' Windows Script Host Object
Set myShell = CreateObject("WScript.Shell")
myShell.Run Filename

Replace "Filename" with the name of the file you want to open.

danovkos
09-08-2009, 10:43 PM
To launch any associated file from VBA, try this:

Dim myShell As Object
' Windows Script Host Object
Set myShell = CreateObject("WScript.Shell")
myShell.Run Filename

Replace "Filename" with the name of the file you want to open.

ok, thank you.
and what if the program is not installed .
can i define the path to program?
thx

JP2112
09-09-2009, 06:57 AM
I've never tested it with a file that doesn't have a program associated with it. Open Windows Explorer and go to Tools > Folder Options, go to File Types tab and make sure the file extension (in your case, .au3) is registered and set to open with a specific program.

danovkos
09-09-2009, 11:11 PM
ok thx
ill try