We help IT Professionals succeed at work.
Get Started

How to use VBS Methods

Last Modified: 2012-05-12
Hello everyone.. Its my first post.. So hopefully I won't sound stupid.. LOL

I would like to create method with the following lines and be able to reference the lines within an IF Then statement using VBS

      For i = 0 To UBound(aryDeptPath)      
            If InStr(strGroup, "cn=" & Lcase(aryDeptPath(i,0))) then
                  objNetwork.MapNetworkDrive strDeptDriveLetter, aryDeptPath(i,1)
                  Exit For
            End If

The rest of my script work perfectly. I would just like to clean it up a little and I believe if I can create a method and reference it. I will save some lines of code.

Thanks in advance
Watch Question
Awarded 2010
Top Expert 2013
This problem has been solved!
Unlock 1 Answer and 8 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE