I'm looking for the VBA code to get the current folder name. I know the code to get the entire path is ActiveDocument.Path but I only want the part of the path after the last "\". Thanks, this is my first post.
I'm looking for the VBA code to get the current folder name. I know the code to get the entire path is ActiveDocument.Path but I only want the part of the path after the last "\". Thanks, this is my first post.
There are a few ways to do that. One I use isInstrRev returns the last position in the String of the second argument: ("\")CurrentFolder =Mid(ActiveDocument.Path, InstrRev(ActiveDocument.Path, "\") + 1)
Mid returns everything in the String from the position given in its second argument: (InstrRev(Blahblah) + 1))
I expect the student to do their homework and find all the errrors I leeve in.
Please take the time to read the Forum FAQ
Thanks Sam. That will work.