Ich erstelle mit dem folgenden Code eine Text-datei,habe versucht den Inhalt dieser Datei mit dem Code zu ersetzen.........ging aber nicht.Kann einer on euch mir vorschlagen wie das geht?
Code:
Private Sub Command10_Click()
Dim iFileNumber As Integer
Dim myFilename As String
Dim myDirectory As String
Dim myYourString As String
Dim myYourString2 As String
Dim Analyses As String
myDirectory = "G:\"
myYourString = Left(Right(CurrentDb.Name, Len(CurrentDb.Name) - InStrRev(CurrentDb.Name, "\")), InStr(Right(CurrentDb.Name,
Len(CurrentDb.Name) - InStrRev(CurrentDb.Name, "\")), ".") - 1)
myYourString2 = "++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++"
myFilename = Trim(Str(Year(Now()))) & "_" & Trim(Str(Year(Now()))) & "_" & Trim(Str(Month(Now()))) & "_" & Trim(Str(Day(Now()))) & ".txt"
iFileNumber = FreeFile
If Dir(myDirectory, vbDirectory) = "" Then MkDir (myDirectory)
How to ovverwrite the file here
Open myDirectory & myFilename & ".txt" For Append As iFileNumber
Print #iFileNumber, myYourString
Print #iFileNumber, myYourString2
Close #iFileNumber
End Sub
Zuletzt bearbeitet: