Quick test professional

QTP Tips QTP codes QTP Faqs and more

Creating a Microsoft Word document

Creating a Microsoft Word document  

Example:
Dim objWD

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

‘ Create a new document
objWD.Documents.Add

‘ 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
objWD.Quit

‘ Release the Word

Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: