Создание произвольного файла во временной папке WindowsПо материалам: https://support.microsoft.com/ Sample Function to Generate a Random Temporary File Name Function MakeTempFileName(Extension As String) As String On Error Resume Next Dim Isfile As Integer, FHandle As Integer, Cntr As Integer Dim WinTemp As String, TF As String Isfile = False FHandle = FreeFile Do WinTemp = Environ("TEMP") & "\" For Cntr = 1 To 8 WinTemp = WinTemp & Mid(LTrim(Str(CInt(Rnd * 10))), 1, 1) Next TF = Trim(WinTemp$) & "." & Extension Open TF For Output As #FHandle Debug.Print TF Print #FHandle, "This is a Temp file" Loop While Err > 0 Close #FHandle MakeTempFileName = TF End Function Type the following line in the Debug window (or Immediate window in versions 1.x and 2.0), and then presss ENTER: |
|||
L.E. 27.06.2022 |