Quick test professional

QTP Tips QTP codes QTP Faqs and more

Creating a Microsoft Word document

Creating a Microsoft Word document  

Dim objWD

‘ Create the Word Object
Set objWD = CreateObject(“Word.Application”)

‘ Create a new document

‘ Add text to the document
objWD.Selection.TypeText “This is some text.” & Chr(13) & “This is some more text”

‘ Save the document
objWD.ActiveDocument.SaveAs “c:\temp\mydoc.doc”

‘ Quit Word

‘ Release the Word


February 14, 2008 - Posted by | Automating MS Word

1 Comment »

  1. dll file

    Comment by mahsa | November 5, 2009 | Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: