Micro Focus QTP (UFT) Forums
Unable to open a doc file. - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Unable to open a doc file. (/Thread-Unable-to-open-a-doc-file)



Unable to open a doc file. - Anug - 05-20-2009

I want to write in a doc file but i m unable to open a doc file with the help of FSO ...
Kindly reply me...
what should i do for this?


RE: Unable to open a doc file. - sreekanth chilam - 05-20-2009

Hi ,

Instead of FSO(FileSystemObject), u can use "Word.Application"

Just try with the below approach:
Code:
Dim word
Set word = CreateObject( "Word.Application" )
word.Visible = True
Set doc= word.Documents.Open("Give ur required Word Doc. Path")



RE: Unable to open a doc file. - manojith1984 - 05-20-2009

Hi,
This would help you to create a Word file and access it
Code:
Set objWord = CreateObject("Word.Application")
objWord.Visible = True
Set objDoc = objWord.Documents.Add()