Hanging word.application,Not proceeding anymore kindly suggest

Hello All,

On Error Resume Next

Set objWord=GetObject(,"Word.Application")

If objWord isNothingThen

Set objword=Createobject("Word.Application")

EndIf



OnErrorGoTo0

                objword.Documents.Open "C:\Test.Docx"
                objword.ActiveDocument.Activate

                objWord.Selection.TypeText "Hello World-Testing happening here buddy"

                objWord.ActiveDocument.save

                objWord.ActiveDocument.Close

                objWord.Quit

Set objWord=Nothing

Scenario 1:

No Word instances in my task manager,i dint open my document and ran this code-It just add the value i meantioned and save succesfully

Secanrio 2:

I Open my Document and run this code and it hangs-I am running it through UFT-Automation tool.

Kindly Help

Thanks,

Narayan

                                                                                                                                                              
April 7th, 2015 6:26am

Hi,

As this issue is related to Word Development, I think the more appropriate place to discuss this is Word for Developers forum:

https://social.msdn.microsoft.com/Forums/office/en-US/home?forum=worddev

The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.

Regards,

Melon Chen
TechNet Community Su

Free Windows Admin Tool Kit Click here and download it now
April 10th, 2015 1:48am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics