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.

Help with code

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JayM - 10 Jan 2006 13:21 GMT
I'm not very good with writing code from scratch

I have written the below code but can't get it to work - what am I doing
wrong or is it just not possible to do.

The .bat file just copies some folders from one place to another.

Any help would be appreciated

Here is the code:
Sub ClientFolder()
' NewClient Folder Creation

Dim MyFilePath

MyFilePath = InputBox("Please Type the Alphabetical Letter you wish to
create your New Client Folder in:")
If MyFilePath = "A" Then
   dRetVal = Shell("w:\data\_clients\A\_New Client.bat", Mode)
ElseIf MyFilePath = "b" Then
   dRetVal = Shell("w:\data\_clients\B\_New Client.bat", Mode)
End If
End Sub
Kevin B - 10 Jan 2006 14:57 GMT
Rather than shell out you can user the copyfolder method.

In the example below o is delcared as an object and assigned a file system
object value.  The next line copies from the source folder to the target
folder.

Sub CopyFolder()

   Dim o As Object
   
   Set o = CreateObject("Scripting.FileSystemObject")

   o.CopyFolder "C:\Test1", "C:\Test2"
   
   Set o = Nothing
   
End Sub

Signature

Kevin Backmann

> I'm not very good with writing code from scratch
>
[quoted text clipped - 19 lines]
> End If
> End Sub
 
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.