Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / January 2006

Tip: Looking for answers? Try searching our database.

using wildcards and moving folders

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JayM - 10 Jan 2006 21:50 GMT
I have written the following code
Sub ClientFolder()
' New Client Folder Creation

Dim MyFolderName

   MyFolderName = InputBox("Please type Client's Folder Name :")
   MkDir "c:\data2\_Clients\" + MyFolderName
   MkDir "c:\data2\_Clients\" + MyFolderName + "\" + "Bills"
   MkDir "c:\data2\_Clients\" + MyFolderName + "\" + "Documents"
   MkDir "c:\data2\_Clients\" + MyFolderName + "\" + "Correspondence"
     
End Sub

I want to be able to check the first letter of MyFolderName and then move
that folder into c:\data2\_Clients\A (or B or C etc) dependent on what the
initial letter is thereby having 26 folders (A thru' Z) to alphabetically
list all clients

Any help would be greatly appreciated

Thanks
Doug Robbins - Word MVP - 11 Jan 2006 05:25 GMT
How about using:

  MyFolderName = InputBox("Please type Client's Folder Name :")
   MkDir "c:\data2\_Clients\" & Left(MyFolderName, 1) & "\" & MyFolderName
   MkDir "c:\data2\_Clients\" & Left(MyFolderName, 1) & "\" &
MyFolderNameMyFolderName & "\Bills"
   MkDir "c:\data2\_Clients\" & Left(MyFolderName, 1) & "\" &
MyFolderNameMyFolderName & "\Documents"
   MkDir "c:\data2\_Clients\" & Left(MyFolderName, 1) & "\" &
MyFolderNameMyFolderName & "\Correspondence"

Note that you use the ampersand to concatenate the string, not the +

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

>I have written the following code
> Sub ClientFolder()
[quoted text clipped - 18 lines]
>
> Thanks
JayM - 11 Jan 2006 07:40 GMT
What a superstar!

That works perfectly

Thanks for your help

> How about using:
>
[quoted text clipped - 31 lines]
> >
> > Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.