Visual Basic Scripting (VBScript) is a lightweight programming language that provides network administrators with the ability to automate user processes. The scripting language is used for logon scripts, which are run each time a user starts the computer. The VBScript language has the ability to create a Microsoft Word document. This is beneficial for administrators who want to provide a document on the user's desktop.
Open a basic text editor. Most system administrators use Microsoft Notepad to create VBScript logon scripts.
Initialize the Word application object on the user's machine. The following code initializes the Word application object, which is later used to create the document:
Set word = CreateObject(”Word.Application”)
Add the document. When you open the Word application using VBScript, the object is open but no document is created. The following code creates a document for the container:
Set document = word.Documents.Add()
Add some verbiage to the opened document. The following code illustrates how to add text to your Word document:
document.TypeText “My first document”
Save the document to the hard drive. The following code copies the newly created Word document to the hard drive and closes the Word application:
- Photo Credit computers network image by Orlando Florin Rosu from Fotolia.com
How to Create Word Document From ASP
It's a common task for websites to deliver reports to the user as downloaded documents. Frequently, users will want Microsoft Word files....
How to Make a Word Document into a PDF File and a PDF File into a Word Document for Free
Word and PDF files are two common formats used in creating documents. Word files are editable documents, which means that a recipient...
How to Convert Microsoft Word Documents to HTML
Microsoft Word allows you to convert Word documents to HTML, adding tags and formatting as needed.