Loading
Scriptbox
 VBScript Links 
 About VBscript 
 JavaScript Links 
 About JavaScript 
 Powershell Links 
 PSCRIPT the Script Launcher 
 PowerShell Shortcut Keys 
 About Powershell 
     VBScript
    JavaScript
    Powershell
Disclaimer
Contact
Latest 10 Scripts
Script search
  :: { Category } :: 0-9ABCDEFGHIJKLMNOPQRSTUVWXYZ
         

Search Options:  Add  the  Last  Lines  from  a  Group  of  Text  Files  to  a  Word  Document  

 Content of Add the Last Lines from a Group of Text Files to a Word Document.vbs
MD5 Hash: 35C3B30B6169E5FF485AE4B612C14005
Const ForReading = 1

Set objFSO = CreateObject("Scripting.FileSystemObject")

strComputer = "."

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

Set colFileList = objWMIService.ExecQuery _
("ASSOCIATORS OF {Win32_Directory.Name='C:\Logs'} Where " _
& "ResultClass = CIM_DataFile")

For Each objFile In colFileList
strFilePath = objFile.Name
Set objTextFile = objFSO.OpenTextFile(strFilePath, ForReading)
Do Until objTextFile.AtEndOfStream
strLine = objTextFile.ReadLine
Loop
strMessage = strMessage & strLine & vbCrLf
objTextFile.Close
Next

Set objWord = CreateObject("Word.Application")
objWord.Visible = True
Set objDoc = objWord.Documents.Add()

Set objSelection = objWord.Selection
objSelection.TypeText strMessage



   © 2008 - 2013 Boris Toll      :: Scripts available: 6.481 ::      :: scriptbox.toll.at ::      :: powered by www.toll.at ::
  Google Entries:n/a
  Yahoo Backlinks:n/a
  Live Backlinks:n/a
  del.icio.us Bookmarks:n/a
  Technorati Links:n/a