Grab our RSS feeds Follow us on Twitter Join our Facebook Group Connect with us on LinkedIn
myITforum.com, Powered by You.
you are not logged in

Articles

Newslinks

Links

Downloads

Site Services

Community Forums

Discussion Lists

Article Search

Newsletter

Web Blogs

FAQs

Live Support

myITforum TV

Take a Poll

Monthly Drawing

myITforum Network

User Group Directory

Our Partners

About Us

Register

Login

BRONZE PARTNER:

BRONZE PARTNER:



Industry News:




  Home : Articles : Microsoft Office print | email | | Forums |   print | email | | Blogs |   print | email | | Wiki |   print | email | | FAQs |   print | email | Article Search  
VBS Script To Send Office 2007 OLE DB Provider Information To A New Word Document


Bookmark and Share

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"


  myITforum.com ©2010 | Legal | Privacy