Hi there i was wondering how you make a folder in code to place a text document. another words, i want to create a folder for a text file i create so when iim done with writing the txt file it will create a folder to store it in. But i don't know how to do this this is my code.
Create My Folder:
Place Folder In this But Where?
I hope this explains it all if not tell me and i will try again.
lee123
Create My Folder:
Code:
Private Sub newfolder()
'This is the folder I want to create
'----------------------------------------------------------------------
Dim ofilesys As New FileSystemObject
Dim ofolder As Folder
Set ofolder = ofilesys.CreateFolder("C:\Program Files\MyDiary")
End Sub
Code:
Private Sub SaveToLog()
' I want the created folder to be in here somewhere but WHERE!
'-------------------------------------------------------------
Dim ff
ff = FreeFile
Open "C:\MyDiary.txt" For Append As #ff
Print #ff, vbNewLine; "Name" & " " & User; vbNewLine _
& " " & "Subject" & " " & Subject; vbNewLine _
& " " & "Date" & " " & DateOfEntry; vbNewLine _
& " " & "Log Entry: " & " " & Log; vbNewLine _
; vbNewLine; DiaryLog & " " & vbNewLine; Now(); vbNewLine
Close #ff
Shell "Notepad.exe C:\MyDiary.txt", vbNormalFocus
DiaryLog.Text = ""
User.Text = ""
Log.Text = ""
Subject.Text = ""
User.SetFocus
End Sub
lee123
Comment