10-04-2012 03:52 PM
This may be a tricky question.
I use a Macro which password protects xml files. The macro %includeds a .vbs program.
options noxsync noxwait;
When the program runs it password protects every file in the folder with the same password -- in the case above "test. I need to change this so the password is different for every file.
The password starts with the letters ORE and then the code which is the first three characters in the file name.
For file :
"700 FY13 Report.xml" The password needs to be ORE700
"B06 FY13 Report.xml" The password needs to be OREB06
"J10 FY13 Q1 Report.xml" The password needs to be OREJ10
Is there a way to read the first three characters of a file name and then use those characters in the password?
You feedback is appreciated!
10-06-2012 04:25 AM
You don't show us your code so it's a bit hard to give you a concrete answer.
On a general level: Wouldn't a substring() function with the filename as source string give you what you need? ... substrn(scan("B06 FY13 Report.xml",-2,'/\.'),1,3)