Tip of the moment is: Microsoft Scripting Runtime skipanir (Word)
Stefjan opnar Word og öll Word skjöl í tiltekinni möppu.
Private Sub cmdOpnaWord_Click()
'Tools-Refrence: Microsoft Word Object Library
'Tools-Refrence: Microsoft Scripting Runtime
Dim docWord As New Word.Application
Dim strPath As String
Dim fsoSysObj As FileSystemObject
Dim theFolder
Dim wordFile As File
Dim intDocCount As Integer
strPath = "C:\SomeFolder" & me.LastName
Set fsoSysObj = New FileSystemObject
Set theFolder = fsoSysObj.GetFolder(strPath)
docWord.Visible = True
For Each wordFile In theFolder.Files
If Right(fsoSysObj.GetFileName(wordFile), 3) = "doc" And
_
Left(fsoSysObj.GetFileName(wordFile), 1) <> "~"
Then
docWord.Documents.Open (wordFile)
End If
Next wordFile
End Sub
Bibliography: http://msdn.microsoft.com/library/default.asp?url=/library/en- us/modcore/html/deconthemicrosoftscriptingruntimeobjectlibrary.asp See also: 14871