Hi
Does anyone have any VB Code that can create a folder if it does not exist?
Perhaps C:\temp ? And if it does exists, don't do anything.
Where can I look for code like that?
Helmut Weber - 04 Feb 2006 13:16 GMT
Hi,
Sub test09987645()
On Error GoTo alreadythere
MkDir "c:\test"
Exit Sub
alreadythere:
If Err.Number = 75 Then
MsgBox "alreadythere"
Else
MsgBox "other error"
End If
End Sub

Signature
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
Doug Robbins - Word MVP - 04 Feb 2006 13:55 GMT
On Error GoTo mdir
ChDir "C:\wonder"
mdir:
If Err.Number = 76 Then
MkDir "c:\wonder"
Else
Exit Sub
End If

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
> Hi
>
> Does anyone have any VB Code that can create a folder if it does not
> exist? Perhaps C:\temp ? And if it does exists, don't do anything.
>
> Where can I look for code like that?