Open main menu
Home
Random
Log in
Settings
About RobotX
Disclaimers
RobotX
Search
Changes
Joelmartin/Sandbox
← Older edit
Newer edit →
User:Joelmartin/Sandbox
(view source)
Revision as of 00:50, 10 April 2020
786 bytes added
,
00:50, 10 April 2020
m
→Title 1
Line 1:
Line 1:
=Title 1=
=Title 1=
+
<source lang="VBA">
+
Dim filePath As String
+
filePath = "C:\Users\joel.martin\Downloads\wikiMarkup.txt"
+
+
' The advantage of correctly typing fso as FileSystemObject is to make autocompletion
+
' (Intellisense) work, which helps you avoid typos and lets you discover other useful
+
' methods of the FileSystemObject
+
Dim fso As FileSystemObject
+
Set fso = New FileSystemObject
+
Dim fileStream As TextStream
+
+
' Here the actual file is created and opened for write access
+
Set fileStream = fso.CreateTextFile(filePath)
+
+
' Write something to the file
+
fileStream.WriteLine "something"
+
+
' Close it, so it is not locked anymore
+
fileStream.Close
+
+
' Here is another great method of the FileSystemObject that checks if a file exists
+
</source>
+
+
+
{| {{Table|sort|class=left}}
{| {{Table|sort|class=left}}
Joelmartin
Bots
,
Bureaucrats
, contributor,
Interface administrators
, lookupuser,
Administrators
4,000
edits