Discussion:
Get part of a path from a shared folder
(too old to reply)
HenrikH
2009-09-10 13:49:43 UTC
Permalink
Hi

I have a shared folder/drive called "H:". It points to the folder "\
\server\appl\gr-30\afd-53" on a shared drive.


So selecting the "H:" drive i explorer would show the files on "\
\server\appl\gr-30\afd-53" folder.


I want to get "gr-30" -part from the path and use it in a Outlook
macro.


Is this possible?
Ken Slovak - [MVP - Outlook]
2009-09-10 14:06:52 UTC
Permalink
Use the Split() function to return an array split from that string on the
"\" character. Access the member of the array you want.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm
Post by HenrikH
Hi
I have a shared folder/drive called "H:". It points to the folder "\
\server\appl\gr-30\afd-53" on a shared drive.
So selecting the "H:" drive i explorer would show the files on "\
\server\appl\gr-30\afd-53" folder.
I want to get "gr-30" -part from the path and use it in a Outlook
macro.
Is this possible?
HenrikH
2009-09-10 16:17:31 UTC
Permalink
Thanks Ken

But I'm not sure how to get the member of the array I want.

How do I get the string / read the path ?
Ken Slovak - [MVP - Outlook]
2009-09-10 16:57:02 UTC
Permalink
That depends on lots of things, none of which have anything to do with
Outlook.

If this is VBA code you could use Windows scripting and the
FileSystemObject's GetDrive() method and once you have that Drive object you
could use its Path property. There are many other ways to do that including
using Win32 API calls. Again though, this has nothing at all to do with
Outlook.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm
Post by HenrikH
Thanks Ken
But I'm not sure how to get the member of the array I want.
How do I get the string / read the path ?
Loading...