BRONZE PARTNER:
BRONZE PARTNER:
Industry News:

| |
| |
 |
 |
 |
 |
 |
| VBS Script To Send Office 2007 OLE DB Provider Information To A New Word Document |
 |
|
|
By: Don Hite
Posted On: 12/14/2007
This article was Previously posted on Don Hite's Blog
This VBS script will allow you to enter a machine name from an input dialog box and will write the Office 2007 OLE provider information for the machine to a new Word Document. The table will include the OLE provider name and version for the driver.
Note: For Microsoft Office 2003 change MsApps12 to MsApps11.
VBS Script:
strComputer = InputBox ("Enter Machine Name")
Const Number_Of_Rows = 1 Const Number_Of_Columns = 2 Set objWord = CreateObject("Word.Application") objWord.Visible = True Set objDoc = objWord.Documents.Add() Set objRange = objDoc.Range() objDoc.Tables.Add objRange, Number_Of_Rows, Number_Of_Columns Set objTable = objDoc.Tables(1) objTable.Cell(1, 1).Range.Text = "OLE Provider Name" objTable.Cell(1, 2).Range.Text = "Version" i = 2
On Error Resume Next Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\MsApps12") Set colItems = objWMIService.ExecQuery("Select * from Win32_OleDbProvider")
For Each objItem in colItems objTable.Rows.Add() objTable.Cell(i, 1).Range.Text = objItem.Name objTable.Cell(i, 2).Range.Text = objItem.Version i = i + 1 Next
objTable.AutoFormat(23) MsgBox "Done"
|
 |
 |
 |
|
|