Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Sub AutoNew()
Dim strFolder As String
Dim strFilename As String
strFolder = "C:\Temp\Testing Folder"
strFilename = "File "
' Determine whether folder exists in C:\Temp
If Dir(strFolder, vbNormal) <> "" Then
' Folder already exists
Else
' Folder needs to be created
MkDir strFolder
End If
' Save new file. If file already exists, add a number at the end to protect
' original file
If Dir(strFolder & "\" & strFilename & ".doc") = "" Then
ActiveDocument.SaveAs (strFolder & "\" & strFilename & ".doc")
Else
N = 1
Do While Dir(strFolder & "\" & strFilename & N & ".doc") <> ""
N = N + 1
Loop
ActiveDocument.SaveAs strFolder & "\" & strFilename & N & ".doc"
End If
End Sub
' Determine whether folder exists in C:\Temp
If Dir(strFolder, vbDirectory) = "" Then
' No it doesn't, so carry on...
If Dir (strFolder, vbNormal) <> "" Then Kill strFolder
' delete any normal file with that name.
' now create the folder
MkDir strFolder
End If