Files: properties and methods





In VBA several different libraries contain methods to retreive file prperties or to manipulate files.
Sometimes a library contains unique methods, sometimes they are equivalents to methods in another library.
Which method you can use can be dependent of whether a file has been loaded or not.

In the examples in this page we'll illustrate the following libraries:
VBA
Excel VBA
Word VBA
Scripting ("scripting.filesystemobject")
Shell ("shell.application")
Shellscripting ("wscript.shell")

In VBA you can refer to an open file in several ways:
the file that contains the code that is being executed:
in Word: ThisDocument
in Excel: ThisWorkbook

the most recent active file:
in Word: ActiveDocument
in Excel: ActiveWorkbook
in Powerpoint: ActivePresentation

the name of a member in the collection of open files:
in Word: Documents("name.doc")
in Excel : Workbooks("name.xls")

the indexnumber in the collection of open files:
in Word: Documents(1)
in Excel: Workbooks(1)

In the examples we'll use ThisWorkbook (Excel) and ThisDocument (Word)
As a default each example uses an Excel file (ThisWorkbook); if it's marked green you can always replace that by ThisDocument in Word.
The use of ThisDocument indicates it's an exclusive property/method in Word.

For every property an example of the possible result is indicated in darkred, as far as I'm familiar with it's possible result.

The number of properties of an open file exceeds those of a closed file.
They will be treated seperately.

I Properties: open/loaded file

Name: fullname; drive + path + name + extension
"E:\OF\example.xls"
c007 = ThisWorkbook.FullName
c107 = CreateObject("scripting.filesystemobject").GetAbsolutePathname(ThisWorkbook.FullName)
c207 = CreateObject("scripting.filesystemobject").getfile(ThisWorkbook.FullName).Path
c307 = CreateObject("shell.application").namespace(ThisWorkbook.Path & "\").Items.Item(ThisWorkbook.Name).Path

Name: name including extension
"example.xls"
c001 = ThisWorkbook.Name
c001a=Dir(ThisWorkbook.FullName))
c101 = CreateObject("scripting.filesystemobject").GetFileName(ThisWorkbook.FullName)
c201 = CreateObject("scripting.filesystemobject").getfile(ThisWorkbook.FullName).Name
c301 = CreateObject("shell.application").namespace(ThisWorkbook.Path & "\").Items.Item(ThisWorkbook.Name).Name
With CreateObject("shell.application").namespace(ThisWorkbook.Path & "\")
c401 = .getdetailsof(.Items.Item(ThisWorkbook.Name), 0)
End With
c501 = Mid(Split(CreateObject("wscript.shell").Exec("cmd /c Dir " & Chr(34) & ThisWorkbook.FullName & Chr(34) & " /b").StdOut.ReadAll, vbCrLf)(5), 45)

Name: name without extension
"example"
c102 = CreateObject("scripting.filesystemobject").GetBaseName(ThisWorkbook.FullName)

Name: extension
"xls"
c103 = CreateObject("scripting.filesystemobject").GetExtensionName(ThisWorkbook.FullName)

Name: VBA name
"ThisWorkbook"
c008 = ActiveWorkbook.CodeName

Name: DOS - name
"VOORBE~1.XLS"
c422 = CreateObject("scripting.filesystemobject").getfile(ThisWorkbook.FullName).shortname
c522 = Left(Split(CreateObject("wscript.shell").Exec("cmd /c Dir " & Chr(34) & ThisWorkbook.FullName & Chr(34) & " /b").StdOut.ReadAll, vbCrLf)(5), 12)

Name: DOS - fullname
"E:\OF\VOORBE~1.XLS"
c423 = CreateObject("scripting.filesystemobject").getfile(ThisWorkbook.FullName).shortpath

Path: fullpath without slash, unless in a rootdirectory
"E:\OF"
c004 = ThisWorkbook.Path
c104 = CreateObject("scripting.filesystemobject").GetParentFolderName(ThisWorkbook.FullName)
c204 = CreateObject("scripting.filesystemobject").getfile(ThisWorkbook.FullName).parentfolder

Path: foldername without path
"OF"
c313 = CreateObject("shell.application").namespace(ThisWorkbook.Path & "\").Items.Item(ThisWorkbook.Name).Parent

Drive: drivename
"GEGEVENS ."
c514 = Split(CreateObject("wscript.shell").Exec("cmd /c Dir " & Chr(34) & ThisWorkbook.FullName & Chr(34) & " /b").StdOut.ReadAll, vbCrLf)(1)

Drive: drivenumber
"4FB9-3D9B"
c515 = Split(CreateObject("wscript.shell").Exec("cmd /c Dir " & Chr(34) & ThisWorkbook.FullName & Chr(34) & " /b").StdOut.ReadAll, vbCrLf)(2)

Drive: driveletter + :
"E:"
c116 = CreateObject("scripting.filesystemobject").GetDriveName(ThisWorkbook.FullName)
c216 = CreateObject("scripting.filesystemobject").getfile(ThisWorkbook.FullName).drive
c516 = Split(CreateObject("wscript.shell").Exec("cmd /c Dir " & Chr(34) & ThisWorkbook.FullName & Chr(34) & " /b").StdOut.ReadAll, vbCrLf)(3)

Drive: free space in the drive that contains the opened file
"465. (..) bytes"
c517 = Split(CreateObject("wscript.shell").Exec("cmd /c Dir " & Chr(34) & ThisWorkbook.FullName & Chr(34) & " /b").StdOut.ReadAll, vbCrLf)(7)

Application
"Microsoft Excel"
c005 = ThisWorkbook.Application
c005 = ThisWorkbook.Parent
c015 = ThisWorkbook.BuiltinDocumentProperties(9)
c025 = ThisWorkbook.BuiltinDocumentProperties("application name")

Type
"Microsoft Excel werkblad"
c112 = CreateObject("scripting.filesystemobject").getfile(ThisWorkbook.FullName).Type
c312 = CreateObject("shell.application").namespace(ThisWorkbook.Path & "\").Items.Item(ThisWorkbook.Name).Type
With CreateObject("shell.application").namespace(ThisWorkbook.Path & "\")
c412 = split(.getdetailsof(.Items.Item(ThisWorkbook.Name), -1),vblf)(0)
End With
With CreateObject("shell.application").namespace(ThisWorkbook.Path & "\")
c412a=mid(join(filter(split(.getdetailsof(.Items.Item(Thisworkbook.Name), -1),vblf),"Type: "),""),7)
End With

A music file (mp3)
With CreateObject("shell.application").namespace(***.Path & "\")
c412 = split(.getdetailsof(.Items.Item(***.Name), -1),vblf)(4)
End With
With CreateObject("shell.application").namespace(***.Path & "\")
c412a=mid(join(filter(split(.getdetailsof(.Items.Item(***.Name), -1),vblf),"Type: "),""),7)
End With

An image file
With CreateObject("shell.application").namespace(***.Path & "\")
c512 = split(.getdetailsof(.Items.Item(***.Name), -1),vblf)(3)
End With
With CreateObject("shell.application").namespace(***.Path & "\")
c412a=mid(join(filter(split(.getdetailsof(.Items.Item(***.Name), -1),vblf),"Type: "),""),7)
End With

Fileformat
In Excel
56
c006 = ThisWorkbook.FileFormat
-4158xlCurrentPlatformText 11xlDBF4 20xlTextWindows 29xlExcel3 39xlExcel5 50xlExcel12
-4143xlWorkbookNormal 14xlWJ2WD1 21xlTextMSDOS 30xlWK1FMT 39xlExcel7 51xlOpenXMLWorkbook
2xlSYLK 15xlWK3 22xlCSVMac 31xlWK1ALL 40xlWJ3 51xlWorkbookDefault
4xlWKS 16xlExcel2 23xlCSVWindows 32xlWK3FM3 41xlWJ3FJ3 52xlOpenXMLWorkbookMacroEnabled
5xlWK1 17xlTemplate 24xlCSVMSDOS 33xlExcel4 42xlUnicodeText 53xlOpenXMLTemplateMacroEnabled
6xlCSV 17xlTemplate8 25xlIntlMacro 34xlWQ1 43xlExcel9795 54xlOpenXMLTemplate
7xlDBF2 18xlAddIn 26xlIntlAddIn 35xlExcel4Workbook 44xlHtml 55xlOpenXMLAddIn
8xlDBF3 18xlAddIn8 27xlExcel2FarEast 36xlTextPrinter 45xlWebArchive 56xlExcel8
9xlDIF 19xlTextMac 28xlWorks2FarEast 38xlWK4 46xlXMLSpreadsheet 60xlOpenDocumentSpreadsheet

In Word
0
c006 = ThisDocument.SaveFormat
0wdFormatDocument 3wdFormatTextLineBreaks 7wdFormatEncodedText 12wdFormatXMLDocument 17wdFormatPDF
0wdFormatDocument97 4wdFormatDOSText 8wdFormatHTML 13wdFormatXMLDocumentMacroEnabled 18wdFormatXPS
1wdFormatTemplate 5wdFormatDOSTextLineBreaks 9wdFormatWebArchive 14wdFormatXMLTemplate
1wdFormatTemplate97 6wdFormatRTF 10wdFormatFilteredHTML 15wdFormatXMLTemplateMacroEnabled
2wdFormatText 7wdFormatUnicodeText 11wdFormatXML 16wdFormatDocumentDefault

Size: filesize / filelength in bytes
23876
c009 = FileLen(ThisWorkbook.FullName)
c109 = CreateObject("scripting.filesystemobject").getfile(ThisWorkbook.FullName).Size
c309 = CreateObject("shell.application").namespace(ThisWorkbook.Path & "\").Items.Item(ThisWorkbook.Name).Size
c509 = Mid(Split(CreateObject("wscript.shell").Exec("cmd /c Dir " & Chr(34) & ThisWorkbook.FullName & Chr(34) & " /b").StdOut.ReadAll, vbCrLf)(5), 14, 13)
c609 = Split(CreateObject("wscript.shell").Exec("cmd /c Dir " & Chr(34) & ThisWorkbook.FullName & Chr(34) & " /b").StdOut.ReadAll, vbCrLf)(6)
Open ThisWorkbook.FullName For Input As #1
c709 = LOF(1)
Close

in Word:
c009 = ThisDocument.BuiltinDocumentProperties(22)
c009 = ThisDocument.BuiltinDocumentProperties("number of bytes")

Size: filesize in kbytes
23,8 kB
With CreateObject("shell.application").namespace(ThisWorkbook.Path & "\")
c410 = .getdetailsof(.Items.Item(ThisWorkbook.Name), 1)
End With

Size: fileszie in Mbytes

2,62 MB
A music file (mp3)
With CreateObject("shell.application").namespace(***.Path & "\")
c411 = split(.getdetailsof(.Items.Item(***.Name), -1),vblf)(7)
End With
With CreateObject("shell.application").namespace(***.Path & "\")
c411a=mid(join(filter(split(.getdetailsof(.Items.Item(***.Name), -1),vblf),"Size: "),""),10)
End With

An image file
With CreateObject("shell.application").namespace(***.Path & "\")
c511 = split(.getdetailsof(.Items.Item(***.Name), -1),vblf)(4)
End With
With CreateObject("shell.application").namespace(***.Path & "\")
c511a=mid(join(filter(split(.getdetailsof(.Items.Item(***.Name), -1),vblf),"Size: "),""),10)
End With

An Excel, Word file
With CreateObject("shell.application").namespace(ThisWorkbook.Path & "\")
c611 = split(.getdetailsof(.Items.Item(ThisWorkbook.Name), -1),vblf)(2)
End With
With CreateObject("shell.application").namespace(ThisWorkbook.Path & "\")
c611a=mid(join(filter(split(.getdetailsof(.Items.Item(ThisWorkbook.Name), -1),vblf),"Size: "),""),10)
End With

Attribute: VBA constant
32
c018 = GetAttr(ThisWorkbook.FullName)
c118 = CreateObject("scripting.filesystemobject").getfile(ThisWorkbook.FullName).Attributes
0vbNormal 1vbReadOnly 2vbHidden 4vbSystem 8vbVolume 16vbDirectory 32vbArchive 64vbAlias

Attribute: character
A
With CreateObject("shell.application").namespace(ThisWorkbook.Path & "\")
c318 = .getdetailsof(.Items.Item(ThisWorkbook.Name), 6)
End With
NvbNormal RvbReadOnly HvbHidden SvbSystem VvbVolume DvbDirectory AvbArchive vbAlias

Attribute: readonly
True / False
c019 = ThisWorkbook.ReadOnly

Date/time: file created
23-12-2012 14:08:17
c020 = ThisWorkbook.BuiltinDocumentProperties(11)
c020 = ThisWorkbook.BuiltinDocumentProperties("creation date")
With CreateObject("shell.application").namespace(ThisWorkbook.Path & "\")
c320 = .getdetailsof(.Items.Item(ThisWorkbook.Name), 4)
End With
With CreateObject("shell.application").namespace(ThisWorkbook.Path & "\")
c420 = .getdetailsof(.Items.Item(ThisWorkbook.Name), 31)
End With

Date/time: file last accessed
23-12-2012 14:08:17
c221 = CreateObject("scripting.filesystemobject").getfile(ThisWorkbook.FullName).datelastaccessed' dd-mm- yyyy
c221 = CreateObject("scripting.filesystemobject").getfile(ThisWorkbook.FullName).datecreated
With CreateObject("shell.application").namespace(ThisWorkbook.Path & "\")
c321 = .getdetailsof(.Items.Item(ThisWorkbook.Name), 5)
End With
c521 = Mid(Split(CreateObject("wscript.shell").Exec("cmd /c Dir " & Chr(34) & ThisWorkbook.FullName & Chr(34) & " /b").StdOut.ReadAll, vbCrLf)(5), 19, 15)

An Excel, Word file
With CreateObject("shell.application").namespace(ThisWorkbook.Path & "\")
c621 = split(.getdetailsof(.Items.Item(ThisWorkbook.Name), -1),vblf)(3)
End With
With CreateObject("shell.application").namespace(ThisWorkbook.Path & "\")
c621a=mid(join(filter(split(.getdetailsof(.Items.Item(ThisWorkbook.Name), -1),vblf),"Last modified "),""),15)
End With

Date/time: last saved
23-12-2012 14:08:17
c011 = FileDateTime(ThisWorkbook.FullName)
c111 = ThisWorkbook.BuiltinDocumentProperties(12)
c111 = ThisWorkbook.BuiltinDocumentProperties("last save time")
c211 = CreateObject("scripting.filesystemobject").getfile(ThisWorkbook.FullName).datelastmodified
c311 = CreateObject("shell.application").namespace(ThisWorkbook.Path & "\").Items.Item(ThisWorkbook.Name).ModifyDate
With CreateObject("shell.application").namespace(ThisWorkbook.Path & "\")
c411 = .getdetailsof(.Items.Item(ThisWorkbook.Name), 3) dd-mm-yyyy hh:mm
End With

Date/time: last printed
23-12-2012 14:08:17
c037 = ThisWorkbook.BuiltinDocumentProperties(10)
c037 = ThisWorkbook.BuiltinDocumentProperties("last printdate")

Link
True / False
c424 = CreateObject("shell.application").namespace(ThisWorkbook.Path & "\").Items.Item(ThisWorkbook.Name).IsLink

Browsable
True / False
c425 = CreateObject("shell.application").namespace(ThisWorkbook.Path & "\").Items.Item(ThisWorkbook.Name).IsBrowsable

File
True / False
c426 = CreateObject("shell.application").namespace(ThisWorkbook.Path & "\").Items.Item(ThisWorkbook.Name).IsFileSystem

Folder
True / False
c427 = CreateObject("shell.application").namespace(ThisWorkbook.Path & "\").Items.Item(ThisWorkbook.Name).IsFolder

File exists
True / False
c028 = Dir(ThisWorkbook.FullName) <>""
c128 = CreateObject("scripting.filesystemobject").FileExists(ThisWorkbook.FullName)

Status
"On line"
With CreateObject("shell.application").namespace(ThisWorkbook.Path & "\")
c356 = .getdetailsof(.Items.Item(ThisWorkbook.Name), 7)
End With

Owner
"SNB-8PN11PL\snb"
With CreateObject("shell.application").namespace(ThisWorkbook.Path & "\")
c357 = .getdetailsof(.Items.Item(ThisWorkbook.Name), 8)
End With

Version
With CreateObject("shell.application").namespace(ThisWorkbook.Path & "\")
c358a = .getdetailsof(.Items.Item(ThisWorkbook.Name), 29)
End With

Program description
With CreateObject("shell.application").namespace(ThisWorkbook.Path & "\")
c358b = .getdetailsof(.Items.Item(ThisWorkbook.Name), 30)
End With

Description
With CreateObject("shell.application").namespace(ThisWorkbook.Path & "\")
c360 = .getdetailsof(.Items.Item(ThisWorkbook.Name), 36)
End With

File version
With CreateObject("shell.application").namespace(ThisWorkbook.Path & "\")
c361 = .getdetailsof(.Items.Item(ThisWorkbook.Name), 37)
End With

Product name
With CreateObject("shell.application").namespace(ThisWorkbook.Path & "\")
c362 = .getdetailsof(.Items.Item(ThisWorkbook.Name), 38)
End With

Product version
With CreateObject("shell.application").namespace(ThisWorkbook.Path & "\")
c363 = .getdetailsof(.Items.Item(ThisWorkbook.Name), 39)
End With

Word, Excel, Powerpoint

Title
"Titel 1"
c029 = ThisWorkbook.BuiltinDocumentProperties(1)
c029 = ThisWorkbook.BuiltinDocumentProperties("Title")
With CreateObject("shell.application").namespace (ThisWorkbook.Path & "\")
c329 = .getdetailsof(.Items.Item(ThisWorkbook.Name), 10)
End With

Subject
"Onderwerp 1"
c030 = ThisWorkbook.BuiltinDocumentProperties(2)
c030 = ThisWorkbook.BuiltinDocumentProperties("Subject")
With CreateObject("shell.application").namespace(ThisWorkbook.Path & "\")
c330 = .getdetailsof(.Items.Item(ThisWorkbook.Name), 11)
End With

Author
"Auteur 1"
c031 = ThisWorkbook.BuiltinDocumentProperties(3)
c031 = ThisWorkbook.BuiltinDocumentProperties("Author")
With CreateObject("shell.application").namespace(ThisWorkbook.Path & "\")
c331 = .getdetailsof(.Items.Item(ThisWorkbook.Name), 9)
End With
With CreateObject("shell.application").namespace(ThisWorkbook.Path & "\")
c431 = split(.getdetailsof(.Items.Item(Thisworkbook.Name), -1),vblf)(1)
End With
With CreateObject("shell.application").namespace(ThisWorkbook.Path & "\")
c431a=mid(join(filter(split(.getdetailsof(.Items.Item(ThisWorkbook.Name), -1),vblf),"Auteur: "),""),9)
End With

Keywords
"Trefwoord 1"
c032 = ThisWorkbook.BuiltinDocumentProperties(4)
c032 = ThisWorkbook.BuiltinDocumentProperties("Keywords")

Comments
"Opmerking 1"
c033 = ThisWorkbook.BuiltinDocumentProperties(5)
c033 = ThisWorkbook.BuiltinDocumentProperties("Comments")
With CreateObject("shell.application").namespace(ThisWorkbook.Path & "\")
c333 = .getdetailsof(.Items.Item(ThisWorkbook.Name), 14)
End With

Template
"normal.dot"
c0034= ThisWorkbook.attachedTemplate
c034 = ThisWorkbook.BuiltinDocumentProperties(6)
c034 = ThisWorkbook.BuiltinDocumentProperties("Template")

Last author
"Auteur 2"
c035 = ThisWorkbook.BuiltinDocumentProperties(7)
c035 = ThisWorkbook.BuiltinDocumentProperties("Last Author")

Revision number
7
c036 = ThisWorkbook.BuiltinDocumentProperties(8)
c036 = ThisWorkbook.BuiltinDocumentProperties("Revision number")

Security
True / False
c043 = ThisWorkbook.BuiltinDocumentProperties(17)
c043 = ThisWorkbook.BuiltinDocumentProperties("security")

Category
"Categorie 1"
c044 = ThisWorkbook.BuiltinDocumentProperties(17)
c044 = ThisWorkbook.BuiltinDocumentProperties("category")
With CreateObject("shell.application").namespace(ThisWorkbook.Path & "\")
c344 = .getdetailsof(.Items.Item(ThisWorkbook.Name), 12)
End With

Format
c045 = ThisWorkbook.BuiltinDocumentProperties(19)
c045 = ThisWorkbook.BuiltinDocumentProperties("format")

Manager
"Manager 1"
c046 = ThisWorkbook.BuiltinDocumentProperties(20)
c046 = ThisWorkbook.BuiltinDocumentProperties("manager")

Company
"Bedrijf 1"
c047 = ThisWorkbook.BuiltinDocumentProperties(21)
c047 = ThisWorkbook.BuiltinDocumentProperties("company")
With CreateObject("shell.application").namespace(ThisWorkbook.Path & "\")
c359 = .getdetailsof(.Items.Item(ThisWorkbook.Name), 35)
End With

Hyperlink base
"E:\OF\"
c054 = ThisWorkbook.BuiltinDocumentProperties(29)
c054 = ThisWorkbook.BuiltinDocumentProperties("hyperlink base")

Word, Powerpoint files

Total editing time
04:12:47
c039 = ThisDocument.BuiltinDocumentProperties(13)
c039 = ThisDocument.BuiltinDocumentProperties("total editing time")

Number of Paragraphs
94
c0049 = ThisDocument.Paragraphs.Count
c049 = ThisDocument.BuiltinDocumentProperties(24)
c049 = ThisDocument.BuiltinDocumentProperties("number of paragraphs")

Number of Words
1356
c0041 = ThisDocument.Words.Count
c041 = ThisDocument.BuiltinDocumentProperties(15)
c041 = ThisDocument.BuiltinDocumentProperties("number of words")

Word files

Number of Pages
17
c040 = ThisDocument.BuiltinDocumentProperties(14)
c040 = ThisDocument.BuiltinDocumentProperties("number of pages")

With CreateObject("shell.application").namespace(ThisDocument.Path & "\")
c340 = .getdetailsof(.Items.Item(ThisDocument.Name), 13)
End With

Number of Lines
130
c0048 = ThisDocument.Sentences.Count
c048 = ThisDocument.BuiltinDocumentProperties(23)
c048 = ThisDocument.BuiltinDocumentProperties("number of lines")

Number of Characters
4503
c0042 = ThisDocument.Characters.Count
c042 = ThisDocument.BuiltinDocumentProperties(16)
c042 = ThisDocument.BuiltinDocumentProperties("number of characters")

Number of Characters with Spaces
5312
c055 = ThisDocument.BuiltinDocumentProperties(30)
c055 = ThisDocument.BuiltinDocumentProperties("Number of characters with spaces")

Powerpoint files

Number of Slides
34
c050 = ActivePresentation.BuiltinDocumentProperties(25)
c050 = ActivePresentation.BuiltinDocumentProperties("number of slides")

Number of Notes
17
c051 = ActivePresentation.BuiltinDocumentProperties(26)
c051 = ActivePresentation.BuiltinDocumentProperties("number of notes")

Number of hidden Slides
4
c052 = ActivePresentation.BuiltinDocumentProperties(27)
c052 = ActivePresentation.BuiltinDocumentProperties("number of hidden slides")

Number of multimediaclips
2
c053 = ActivePresentation.BuiltinDocumentProperties(28)
c053 = ActivePresentation.BuiltinDocumentProperties("number of mediaclips")

Music files

Copyright
With CreateObject("shell.application").namespace(***.Path & "\")
c364 = .getdetailsof(.Items.Item(***.Name), 15)
End With

Artist
"Orchestra of the Age of Enlightenment - Harry Bicket, Lorraine Hunt Lieberson)"
With CreateObject("shell.application").namespace(***.Path & "\")
c365 = .getdetailsof(.Items.Item(***.Name), 16)
End With
With CreateObject("shell.application").namespace(***.Path & "\")
c465 = split(.getdetailsof(.Items.Item(***.Name), -1),vblf)(0)
End With
With CreateObject("shell.application").namespace(***.Path & "\")
c465a=mid(join(filter(split(.getdetailsof(.Items.Item(***.Name), -1),vblf),"Artist: "),""),9)
End With

Album Title
"Handel Arias, Stephen Stubbs - Lute,guit., Carrai-cello, Tendemans- Gamba"
With CreateObject("shell.application").namespace(***.Path & "\")
c366 = .getdetailsof(.Items.Item(***.Name), 17)
End With
With CreateObject("shell.application").namespace(***.Path & "\")
c466 = split(.getdetailsof(.Items.Item(***.Name), -1),vblf)(1)
End With
With CreateObject("shell.application").namespace(***.Path & "\")
c466a=mid(join(filter(split(.getdetailsof(.Items.Item(***.Name), -1),vblf),"Album Title: "),""),14)
End With

Year
2002
With CreateObject("shell.application").namespace(***.Path & "\")
c367 = .getdetailsof(.Items.Item(***.Name), 18)
End With

Track Number
11
With CreateObject("shell.application").namespace(***.Path & "\")
c368 = .getdetailsof(.Items.Item(***.Name), 19)
End With
With CreateObject("shell.application").namespace(***.Path & "\")
c468 = split(.getdetailsof(.Items.Item(***.Name), -1),vblf)(2)
End With
With CreateObject("shell.application").namespace(***.Path & "\")
c468a=mid(join(filter(split(.getdetailsof(.Items.Item(***.Name), -1),vblf),"Track Number: "),""),15)
End With

Genre
"Opera"
With CreateObject("shell.application").namespace(***.Path & "\")
c369 = .getdetailsof(.Items.Item(***.Name), 20)
End With

Duration
00:05:33
With CreateObject("shell.application").namespace(***.Path & "\")
c370 = .getdetailsof(.Items.Item(***.Name), 21)
End With
With CreateObject("shell.application").namespace(***.Path & "\")
c470 = split(.getdetailsof(.Items.Item(***.Name), -1),vblf)(3)
End With
With CreateObject("shell.application").namespace(***.Path & "\")
c470a=mid(join(filter(split(.getdetailsof(.Items.Item(***.Name), -1),vblf),"Duration: "),""),11)
End With

Bit Rate
"128kbps"
With CreateObject("shell.application").namespace(***.Path & "\")
c371 = .getdetailsof(.Items.Item(***.Name), 22)
End With
With CreateObject("shell.application").namespace(***.Path & "\")
c471 = split(.getdetailsof(.Items.Item(***.Name), -1),vblf)(5)
End With
With CreateObject("shell.application").namespace(***.Path & "\")
c471a=mid(join(filter(split(.getdetailsof(.Items.Item(***.Name), -1),vblf),"Bit Rate: "),""),11)
End With

Protected
"Ja /Nee"
With CreateObject("shell.application").namespace(***.Path & "\")
c358 = .getdetailsof(.Items.Item(***.Name), 23)
End With
With CreateObject("shell.application").namespace(***.Path & "\")
c458 = split(.getdetailsof(.Items.Item(***.Name), -1),vblf)(6)
End With
With CreateObject("shell.application").namespace(***.Path & "\")
c458a=mid(join(filter(split(.getdetailsof(.Items.Item(***.Name), -1),vblf),"Protected: "),""),12)
End With

Audio Sample Size
0 bits
With CreateObject("shell.application").namespace(***.Path & "\")
c371a = .getdetailsof(.Items.Item(***.Name), 32)
End With

Sample Rate
44 kHz
With CreateObject("shell.application").namespace(***.Path & "\")
c371b = .getdetailsof(.Items.Item(***.Name), 33)
End With

Channels
1 (mono), 2 (stereo), 4 (quad)
With CreateObject("shell.application").namespace(***.Path & "\")
c371c = .getdetailsof(.Items.Item(***.Name), 34)
End With

Image files

Camera Model
DMC-FS11
With CreateObject("shell.application").namespace(***.Path & "\")
c372 = .getdetailsof(.Items.Item(***.Name), 24)
End With
With CreateObject("shell.application").namespace(***.Path & "\")
c472 = split(.getdetailsof(.Items.Item(***.Name), -1),vblf)(2)
End With
With CreateObject("shell.application").namespace(***.Path & "\")
c472a=mid(join(filter(split(.getdetailsof(.Items.Item(***.Name), -1),vblf),"Camera Model: "),""),15)
End With

Date Picture taken
27-05-2011 12:29
With CreateObject("shell.application").namespace(***.Path & "\")
c373 = .getdetailsof(.Items.Item(***.Name), 25)
End With
With CreateObject("shell.application").namespace(***.Path & "\")
c473 = split(.getdetailsof(.Items.Item(***.Name), -1),vblf)(1)
End With
With CreateObject("shell.application").namespace(***.Path & "\")
c473a=mid(join(filter(split(.getdetailsof(.Items.Item(***.Name), -1),vblf),"Date Picture taken: "),""),21)
End With

Dimensions
4320 x 3240
With CreateObject("shell.application").namespace(***.Path & "\")
c374 = .getdetailsof(.Items.Item(***.Name), 26)
End With
With CreateObject("shell.application").namespace(***.Path & "\")
c474 = split(.getdetailsof(.Items.Item(***.Name), -1),vblf)(0)
End With
With CreateObject("shell.application").namespace(***.Path & "\")
c474a=mid(join(filter(split(.getdetailsof(.Items.Item(***.Name), -1),vblf),"Dimensions: "),""),12)
End With

Pixels horizontally
4320
With CreateObject("shell.application").namespace(***.Path & "\")
c375 = .getdetailsof(.Items.Item(***.Name), 27)
End With

Pixels vertically
3240
With CreateObject("shell.application").namespace(***.Path & "\")
c376 = .getdetailsof(.Items.Item(***.Name), 28)
End With

II Properties: closed file

Name: fullname; drive + path + name + extension
"E:\OF\example.xls"
c107 = CreateObject("scripting.filesystemobject").GetAbsolutePathname("E:\OF\example.xls")
c207 = CreateObject("scripting.filesystemobject").getfile("E:\OF\example.xls").Path
c307 = CreateObject("shell.application").namespace("E:\OF\").Items.Item("example.xls").Path

Name: name including extension
"example.xls"
c001a=Dir("E:\OF\example.xls"))
c101 = CreateObject("scripting.filesystemobject").GetFileName("E:\OF\example.xls")
c201 = CreateObject("scripting.filesystemobject").getfile("E:\OF\example.xls").Name
c301 = CreateObject("shell.application").namespace("E:\OF\").Items.Item("example.xls").Name
With CreateObject("shell.application").namespace("E:\OF\")
c401 = .getdetailsof(.Items.Item("example.xls"), 0)
End With
c501 = Mid(Split(CreateObject("wscript.shell").Exec("cmd /c Dir " & Chr(34) & "E:\OF\example.xls" & Chr(34) & " /b").StdOut.ReadAll, vbCrLf)(5), 45)

Name: name without extension
"example"
c102 = CreateObject("scripting.filesystemobject").GetBaseName("E:\OF\example.xls")

Name: extension
"xls"
c103 = CreateObject("scripting.filesystemobject").GetExtensionName("E:\OF\example.xls")

Path: fullpath without slash, unless in rootdirectory
"E:\OF"
c104 = CreateObject("scripting.filesystemobject").GetParentFolderName("E:\OF\example.xls")
c204 = CreateObject("scripting.filesystemobject").getfile("E:\OF\example.xls").parentfolder

Path: foldername without path
"OF"
c313 = CreateObject("shell.application").namespace("E:\OF\").Items.Item("example.xls").Parent

Drive: drivename
"GEGEVENS ."
c514 = Split(CreateObject("wscript.shell").Exec("cmd /c Dir " & Chr(34) & "E:\OF\example.xls" & Chr(34) & " /b").StdOut.ReadAll, vbCrLf)(1)

Drive: drivenumber
"4FB9-3D9B"
c515 = Split(CreateObject("wscript.shell").Exec("cmd /c Dir " & Chr(34) & "E:\OF\example.xls" & Chr(34) & " /b").StdOut.ReadAll, vbCrLf)(2)

Drive: driveletter + :
"E:"
c116 = CreateObject("scripting.filesystemobject").GetDriveName("E:\OF\example.xls")
c216 = CreateObject("scripting.filesystemobject").getfile("E:\OF\example.xls").drive
c516 = Split(CreateObject("wscript.shell").Exec("cmd /c Dir " & Chr(34) & "E:\OF\example.xls" & Chr(34) & " /b").StdOut.ReadAll, vbCrLf)(3)

Drive: free space in file containing drive
"465. (..) bytes"
c517 = Split(CreateObject("wscript.shell").Exec("cmd /c Dir " & Chr(34) & "E:\OF\example.xls" & Chr(34) & " /b").StdOut.ReadAll, vbCrLf)(7)

Type
"Microsoft Excel werkblad"
c112 = CreateObject("scripting.filesystemobject").getfile("E:\OF\example.xls").Type
c312 = CreateObject("shell.application").namespace("E:\OF\").Items.Item("example.xls").Type
With CreateObject("shell.application").namespace("E:\OF\")
c412 = split(.getdetailsof(.Items.Item("example.xls"), -1),vblf)(0)
End With
With CreateObject("shell.application").namespace("E:\OF\")
c412a=mid(join(filter(split(.getdetailsof(.Items.Item("example.xls"), -1),vblf),"Type: "),""),7)
End With

A music file (mp3)
With CreateObject("shell.application").namespace("E:\OF\")
c412 = split(.getdetailsof(.Items.Item("example.mp3"), -1),vblf)(4)
End With
With CreateObject("shell.application").namespace("E:\OF\")
c412a=mid(join(filter(split(.getdetailsof(.Items.Item("example.mp3"), -1),vblf),"Type: "),""),7)
End With

An image file
With CreateObject("shell.application").namespace("E:\OF\")
c512 = split(.getdetailsof(.Items.Item("example.jpg"), -1),vblf)(3)
End With
With CreateObject("shell.application").namespace("E:\OF\")
c412a=mid(join(filter(split(.getdetailsof(.Items.Item("example.jpg"), -1),vblf),"Type: "),""),7)
End With

Size: filesize / filelength in bytes
23876
c009 = FileLen("E:\OF\example.xls")
c109 = CreateObject("scripting.filesystemobject").getfile("E:\OF\example.xls").Size
c309 = CreateObject("shell.application").namespace("E:\OF\").Items.Item("example.xls").Size
c509 = Mid(Split(CreateObject("wscript.shell").Exec("cmd /c Dir " & Chr(34) & "E:\OF\example.xls" & Chr(34) & " /b").StdOut.ReadAll, vbCrLf)(5), 14, 13)
c609 = Split(CreateObject("wscript.shell").Exec("cmd /c Dir " & Chr(34) & "E:\OF\example.xls" & Chr(34) & " /b").StdOut.ReadAll, vbCrLf)(6)
Open "E:\OF\example.xls" For Input As #1
c709 = LOF(1)
Close

Size: filesize in kbytes
23,8 kB
With CreateObject("shell.application").namespace("E:\OF\")
c410 = .getdetailsof(.Items.Item("example.xls"), 1)
End With

Size: filesize in Mbytes

2,62 MB
Een geluidsfile (mp3)
With CreateObject("shell.application").namespace("E:\OF\")
c411 = split(.getdetailsof(.Items.Item("example.mp3"), -1),vblf)(7)
End With
With CreateObject("shell.application").namespace("E:\OF\")
c411a=mid(join(filter(split(.getdetailsof(.Items.Item("example.mp3"), -1),vblf),"Size: "),""),10)
End With

An image file
With CreateObject("shell.application").namespace("E:\OF\")
c511 = split(.getdetailsof(.Items.Item("example.jpg"), -1),vblf)(4)
End With
With CreateObject("shell.application").namespace("E:\OF\")
c511a=mid(join(filter(split(.getdetailsof(.Items.Item("example.jpg"), -1),vblf),"Size: "),""),10)
End With

An Excel, Word file
With CreateObject("shell.application").namespace("E:\OF\")
c611 = split(.getdetailsof(.Items.Item("example.xls"), -1),vblf)(2)
End With
With CreateObject("shell.application").namespace("E:\OF\")
c611a=mid(join(filter(split(.getdetailsof(.Items.Item("example.xls"), -1),vblf),"Size: "),""),10)
End With

Attribute: VBA constant
32
c018 = GetAttr("E:\OF\example.xls")
c118 = CreateObject("scripting.filesystemobject").getfile("E:\OF\example.xls").Attributes ' nummer archive
0vbNormal 1vbReadOnly 2vbHidden 4vbSystem 8vbVolume 16vbDirectory 32vbArchive 64vbAlias

Attribute: charachter
A
With CreateObject("shell.application").namespace("E:\OF\")
c318 = .getdetailsof(.Items.Item("example.xls"), 6)
End With
NvbNormal RvbReadOnly HvbHidden SvbSystem VvbVolume DvbDirectory AvbArchive vbAlias

Date/time: file created
23-12-2012 14:08:17
With CreateObject("shell.application").namespace("E:\OF\")
c320 = .getdetailsof(.Items.Item("example.xls"), 4)
End With
With CreateObject("shell.application").namespace("E:\OF\")
c420 = .getdetailsof(.Items.Item("example.xls"), 31)
End With

Date/time: file last acccessed
23-12-2012 14:08:17
c221 = CreateObject("scripting.filesystemobject").getfile("E:\OF\example.xls").datelastaccessed' dd-mm- yyyy
c221 = CreateObject("scripting.filesystemobject").getfile("E:\OF\example.xls").datecreated
With CreateObject("shell.application").namespace("E:\OF\")
c321 = .getdetailsof(.Items.Item("example.xls"), 5)
End With
c521 = Mid(Split(CreateObject("wscript.shell").Exec("cmd /c Dir " & Chr(34) & "E:\OF\example.xls" & Chr(34) & " /b").StdOut.ReadAll, vbCrLf)(5), 19, 15)

An Excel, Word file
With CreateObject("shell.application").namespace("E:\OF\")
c621 = split(.getdetailsof(.Items.Item("example.xls"), -1),vblf)(3)
End With
With CreateObject("shell.application").namespace("E:\OF\")
c621a=mid(join(filter(split(.getdetailsof(.Items.Item("example.xls"), -1),vblf),"Gewijzigd op: "),""),15)
End With

Date/time: last modified
23-12-2012 14:08:17
c011 = FileDateTime("E:\OF\example.xls")
c211 = CreateObject("scripting.filesystemobject").getfile("E:\OF\example.xls").datelastmodified
c311 = CreateObject("shell.application").namespace("E:\OF\").Items.Item("example.xls").ModifyDate
With CreateObject("shell.application").namespace("E:\OF\")
c411 = .getdetailsof(.Items.Item("example.xls"), 3) dd-mm-yyyy hh:mm
End With

DOS - name
"VOORBE~1.XLS"
c422 = CreateObject("scripting.filesystemobject").getfile("E:\OF\example.xls").shortname
c522 = Left(Split(CreateObject("wscript.shell").Exec("cmd /c Dir " & Chr(34) & "E:\OF\example.xls" & Chr(34) & " /b").StdOut.ReadAll, vbCrLf)(5), 12)

DOS - fullname
"E:\OF\VOORBE~1.XLS"
c423 = CreateObject("scripting.filesystemobject").getfile("E:\OF\example.xls").shortpath

Link
True / False
c424 = CreateObject("shell.application").namespace("E:\OF\").Items.Item("example.xls").IsLink

Browsable
True / False
c425 = CreateObject("shell.application").namespace("E:\OF\").Items.Item("example.xls").IsBrowsable

File
True / False
c426 = CreateObject("shell.application").namespace("E:\OF\").Items.Item("example.xls").IsFileSystem

Folder
True / False
c427 = CreateObject("shell.application").namespace("E:\OF\").Items.Item("example.xls").IsFolder

File exists
True / False
c028 = Dir("E:\OF\example.xls") <>""
c128 = CreateObject("scripting.filesystemobject").FileExists("E:\OF\example.xls")

Status
"On line"
With CreateObject("shell.application").namespace("E:\OF\")
c356 = .getdetailsof(.Items.Item("example.xls"), 7)
End With

Owner
"SNB-8PN11PL\snb"
With CreateObject("shell.application").namespace("E:\OF\")
c357 = .getdetailsof(.Items.Item("example.xls"), 8)
End With

Version
With CreateObject("shell.application").namespace("E:\OF\")
c358a = .getdetailsof(.Items.Item("example.xls"), 29)
End With

Program description
With CreateObject("shell.application").namespace("E:\OF\")
c358b = .getdetailsof(.Items.Item("example.xls"), 30)
End With

Description
With CreateObject("shell.application").namespace("E:\OF\")
c360 = .getdetailsof(.Items.Item("example.xls"), 36)
End With

File version
With CreateObject("shell.application").namespace("E:\OF\")
c361 = .getdetailsof(.Items.Item("example.xls"), 37)
End With

Productname
With CreateObject("shell.application").namespace("E:\OF\")
c362 = .getdetailsof(.Items.Item("example.xls"), 38)
End With

Productversion
With CreateObject("shell.application").namespace("E:\OF\")
c363 = .getdetailsof(.Items.Item("example.xls"), 39)
End With

Word, Excel, Powerpoint

Title
"Titel 1"
CreateObject("shell.application").namespace ("E:\OF\")
c329 = .getdetailsof(.Items.Item("example.xls"), 10)
End With

Subject
"Onderwerp 1"
With CreateObject("shell.application").namespace("E:\OF\")
c330 = .getdetailsof(.Items.Item("example.xls"), 11)
End With

Author
"Auteur 1"
With CreateObject("shell.application").namespace("E:\OF\")
c331 = .getdetailsof(.Items.Item("example.xls"), 9)
End With
With CreateObject("shell.application").namespace("E:\OF\")
c431 = split(.getdetailsof(.Items.Item("example.xls"), -1),vblf)(1)
End With
With CreateObject("shell.application").namespace("E:\OF\")
c431a=mid(join(filter(split(.getdetailsof(.Items.Item("example.xls"), -1),vblf),"Auteur: "),""),9)
End With

Comments
"Opmerking 1"
With CreateObject("shell.application").namespace("E:\OF\")
c333 = .getdetailsof(.Items.Item("example.xls"), 14)
End With

Category
"Categorie 1"
With CreateObject("shell.application").namespace("E:\OF\")
c344 = .getdetailsof(.Items.Item("example.xls"), 12)
End With

Company
"Bedrijf 1"
With CreateObject("shell.application").namespace("E:\OF\")
c359 = .getdetailsof(.Items.Item("example.xls"), 35)
End With

Word file

Number of Pages
17
With CreateObject("shell.application").namespace("E:\OF\")
c340 = .getdetailsof(.Items.Item("example.doc"), 13)
End With

Music file

Copyright
With CreateObject("shell.application").namespace("E:\OF\")
c364 = .getdetailsof(.Items.Item("example.mp3"), 15)
End With

Artist
"Orchestra of the Age of Enlightenment - Harry Bicket, Lorraine Hunt Lieberson)"
With CreateObject("shell.application").namespace("E:\OF\")
c365 = .getdetailsof(.Items.Item("example.mp3"), 16)
End With
With CreateObject("shell.application").namespace("E:\OF\")
c465 = split(.getdetailsof(.Items.Item("example.mp3"), -1),vblf)(0)
End With
With CreateObject("shell.application").namespace("E:\OF\")
c465a=mid(join(filter(split(.getdetailsof(.Items.Item("example.mp3"), -1),vblf),"Artist: "),""),9)
End With

Album Title
"Handel Arias, Stephen Stubbs - Lute,guit., Carrai-cello, Tendemans- Gamba"
With CreateObject("shell.application").namespace("E:\OF\")
c366 = .getdetailsof(.Items.Item("example.mp3"), 17)
End With
With CreateObject("shell.application").namespace("E:\OF\")
c466 = split(.getdetailsof(.Items.Item("example.mp3"), -1),vblf)(1)
End With
With CreateObject("shell.application").namespace("E:\OF\")
c466a=mid(join(filter(split(.getdetailsof(.Items.Item("example.mp3"), -1),vblf),"Album Title: "),""),14)
End With

Year
2002
With CreateObject("shell.application").namespace("E:\OF\")
c367 = .getdetailsof(.Items.Item("example.mp3"), 18)
End With

Track Number
11
With CreateObject("shell.application").namespace("E:\OF\")
c368 = .getdetailsof(.Items.Item("example.mp3"), 19)
End With
With CreateObject("shell.application").namespace("E:\OF\")
c468 = split(.getdetailsof(.Items.Item("example.mp3"), -1),vblf)(2)
End With
With CreateObject("shell.application").namespace("E:\OF\")
c468a=mid(join(filter(split(.getdetailsof(.Items.Item("example.mp3"), -1),vblf),"Track Number: "),""),15)
End With

Genre
"Opera"
With CreateObject("shell.application").namespace("E:\OF\")
c369 = .getdetailsof(.Items.Item("example.mp3"), 20)
End With

Duration
00:05:33
With CreateObject("shell.application").namespace("E:\OF\")
c370 = .getdetailsof(.Items.Item("example.mp3"), 21)
End With
With CreateObject("shell.application").namespace("E:\OF\")
c470 = split(.getdetailsof(.Items.Item("example.mp3"), -1),vblf)(3)
End With
With CreateObject("shell.application").namespace("E:\OF\")
c470a=mid(join(filter(split(.getdetailsof(.Items.Item("example.mp3"), -1),vblf),"Duration: "),""),11)
End With

Bit Rate
"128kbps"
With CreateObject("shell.application").namespace("E:\OF\")
c371 = .getdetailsof(.Items.Item("example.mp3"), 22)
End With
With CreateObject("shell.application").namespace("E:\OF\")
c471 = split(.getdetailsof(.Items.Item("example.mp3"), -1),vblf)(5)
End With
With CreateObject("shell.application").namespace("E:\OF\")
c471a=mid(join(filter(split(.getdetailsof(.Items.Item("example.mp3"), -1),vblf),"Bit Rate: "),""),11)
End With

Protected
"Ja /Nee"
With CreateObject("shell.application").namespace("E:\OF\")
c358 = .getdetailsof(.Items.Item("example.xls"), 23)
End With
With CreateObject("shell.application").namespace("E:\OF\")
c458 = split(.getdetailsof(.Items.Item("example.mp3"), -1),vblf)(6)
End With
With CreateObject("shell.application").namespace("E:\OF\")
c458a=mid(join(filter(split(.getdetailsof(.Items.Item("example.mp3"), -1),vblf),"Protected: "),""),12)
End With

Audio Sample Size
0 bits
With CreateObject("shell.application").namespace("E:\OF\")
c371a = .getdetailsof(.Items.Item("example.mp3"), 32)
End With

Sample Rate
44 kHz
With CreateObject("shell.application").namespace("E:\OF\")
c371b = .getdetailsof(.Items.Item("example.mp3"), 33)
End With

Channels
1 (mono), 2 (stereo), 4 (quad)
With CreateObject("shell.application").namespace("E:\OF\")
c371c = .getdetailsof(.Items.Item("example.mp3"), 34)
End With

Image file

Camera Model
DMC-FS11
With CreateObject("shell.application").namespace("E:\OF\")
c372 = .getdetailsof(.Items.Item("example.jpg"), 24)
End With
With CreateObject("shell.application").namespace("E:\OF\")
c472 = split(.getdetailsof(.Items.Item("example.jpg"), -1),vblf)(2)
End With
With CreateObject("shell.application").namespace("E:\OF\")
c472a=mid(join(filter(split(.getdetailsof(.Items.Item("example.jpg"), -1),vblf),"Camera Model: "),""),15)
End With

Date Picture Taken
27-05-2011 12:29
With CreateObject("shell.application").namespace("E:\OF\")
c373 = .getdetailsof(.Items.Item("example.jpg"), 25)
End With
With CreateObject("shell.application").namespace("E:\OF\")
c473 = split(.getdetailsof(.Items.Item("example.jpg"), -1),vblf)(1)
End With
With CreateObject("shell.application").namespace("E:\OF\")
c473a=mid(join(filter(split(.getdetailsof(.Items.Item("example.jpg"), -1),vblf),"Dat Picture Taken: "),""),24)
End With

Size
4320 x 3240
With CreateObject("shell.application").namespace("E:\OF\")
c374 = .getdetailsof(.Items.Item("example.jpg"), 26)
End With
With CreateObject("shell.application").namespace("E:\OF\")
c474 = split(.getdetailsof(.Items.Item("example.jpg"), -1),vblf)(0)
End With
With CreateObject("shell.application").namespace("E:\OF\")
c474a=mid(join(filter(split(.getdetailsof(.Items.Item("example.jpg"), -1),vblf),"Dimensions: "),""),12)
End With
Pixels horizontally
4320
With CreateObject("shell.application").namespace("E:\OF\")
c375 = .getdetailsof(.Items.Item("example.jpg"), 27)
End With

Pixels vertically
3240
With CreateObject("shell.application").namespace("E:\OF\")
c376 = .getdetailsof(.Items.Item("example.jpg"), 28)
End With

Method: copy file

Copy open file
ThisWorkbook.SaveCopyAs "G:\example.xls"
ThisWorkbook.SaveAs "G:\example.xls"
ThisWorkbook.Sheets(1).Copy
ActiveWorkbook.SaveAs "G:\example.xls"
ActiveWorkbook.Close False
CreateObject("scripting.filesystemobject").CopyFile ThisWorkbook.FullName, "G:\example.xls"
CreateObject("shell.application").NameSpace("G:\").CopyHere ThisWorkbook.FullName
Shell "cmd /c copy " & ThisWorkbook.FullName & "G:\example.xls"

Copy 1 closed file
Workbooks.Add("E:\OF\example.xls").SaveAs "E:\OF\kopie van example.xls"
CreateObject("Excel.Application").Workbooks.Add("E:\OF\example.xls").SaveAs "E:\OF\kopie van example.xls"
Filecopy "G:\OF\example.xls","G:\example.xls"
CreateObject("scripting.filesystemobject").CopyFile "G:\OF\example.xls", "G:\example.xls"
CreateObject("scripting.filesystemobject").GetFile("G:\OF\example.xls").Copy "G:\example.xls"
CreateObject("shell.application").NameSpace("G:\").CopyHere "G:\OF\example.xls"
shell "cmd /c copy "G:\OF\example.xls G:\example.xls"
CreateObject("wscript.shell").Run "cmd /c copy "G:\OF\example.xls G:\example.xls"
CreateObject("wscript.shell").Exec "cmd /c copy "G:\OF\example.xls G:\example.xls"

Copy several closed files
CreateObject("scripting.filesystemobject").CopyFile "G:\OF\*.xls", "G:\"
CreateObject("shell.application").NameSpace("G:\").CopyHere "G:\OF\*.xls"
Shell "cmd /c copy G:\OF\*.xls G:\"

Method: move file

Move open file
ThisWorkbook.SaveAs "G:\nieuw\example.xls"

Move 1 closed file to another folder
Name "G:\OF\example.xls" As "G:\example.xls"
CreateObject("scripting.filesystemobject").MoveFile "G:\OF\example.xls", "G:\example.xls"
CreateObject("scripting.filesystemobject").getfile("G:\OF\example.xls").Move "G:\example.xls"
CreateObject("shell.application").NameSpace("G:\").MoveHere "G:\nieuw\example.xls"

Move several closed files to another folder
CreateObject("scripting.filesystemobject").getfile("G:\OF\*.xls").Move "G:\"
CreateObject("shell.application").NameSpace("G:\").MoveHere "G:\OF\*.xls"

Move 1 closed file in the same folder
shell "cmd /c ren "G:\OF\example.xls example_001.xls"
CreateObject("wscript.shell").Run "cmd /c ren "G:\OF\example.xls example_001.xls"
CreateObject("wscript.shell").Exec "cmd /c ren "G:\OF\example.xls example_001.xls"

Move several closed files in the same folder
shell "cmd /c ren "G:\OF\example*.xls example_*.xls"
CreateObject("wscript.shell").Run "cmd /c ren "G:\OF\example*.xls example_*.xls"
CreateObject("wscript.shell").Exec "cmd /c ren "G:\OF\example*.xls example_*.xls"

Method: delete/remove file

Delete 1 closed file
Kill "G:\OF\example.xls"
Application.Recentfiles(1).delete
CreateObject("scripting.filesystemobject").DeleteFile "G:\OF\example.xls"
CreateObject("scripting.filesystemobject").getfile("G:\OF\example.xls").Delete
shell "cmd /c del G:\OF\example.xls"
createobject("wsript.shell").Run "cmd /c del G:\OF\example.xls"
createobject("wsript.shell").Exec "cmd /c del G:\OF\example.xls"
With New Shell
With .NameSpace("E:\OF\").Items.Item("example.xls")
For j = 1 To .Verbs.Count
If .Verbs.Item(j).Name = "Verwi&jderen" Then Exit For
Next
.InvokeVerb .Verbs.Item(j).Name
End With
End With

Delete several closed files
Kill "G:\OF\*.xls"
CreateObject("scripting.filesystemobject").DeleteFile "G:\OF\*.xls"
shell "cmd /c del G:\nieuw\*.xls"
createobject("wscript.shell").Run "cmd /c del G:\OF\*.xls"
createobject("wscript.shell").Exec "cmd /c del G:\OF\*.xls"

Method: new Excel file

New visible Excel file in existing Excel instance
workbooks.add
GetObject(,"Excel.Application").Workbooks.Add()windows(1).visible=true

New invisible Excel file in existing Excel-instantie
workbooks.add().windows(1).visible=false
GetObject(,"Excel.Application").Workbooks.Add

New invisible Excel file in new Excel instance
CreateObject("Excel.Application").Workbooks.Add
GetObject("","Excel.Application").Workbooks.Add

Method: new Word file

New visible Word file in existing Word instance
Documents.Add
GetObject(,"Word.Application").Documents.Add
With GetObject("", "Word.document")
.Activate
End With

New invisible Word file in existing Word instance
Documents.Add.Windows(1).Visible = False
GetObject(, "Word.Application").Documents.Add.Windows(1).Visible = False

New invisible Word file in new Word instance
CreateObject("Word.Aplication").Documents.Add
GetObject("", "Word.Application").Documents.Add
CreateObject("Word.Document")

Method: new TXT/CSV file

Nieuw TXT/CSV file
Open "G:\OF\example.txt" for output As #1
Print #1,"nieuwe tekst"
Close #1
createobject("scripting.filesystemobject").createtextfile("G:\OF\example.txt").write "nieuwe tekst"