How to handle the word document which is already opened(Add content to it) using VbScript using "Word.Application"  method

Hello,

I want to add some content to the word document which is opened already and active using vbscript.

Here is the sample code to have an idea.Kindly Help.

  • Set oWord = CreateObject("Word.Application")
  • oWord.Documents.Open "c:\test.docx" ----->Here i dont want to open the Document as such as my document which is opened already,i have get the control over that document-I try to achive this by using HP UFT tool for word document automation
  • oWord.Selection.EndKey 6,0
  • oWord.Selection.TypeText " This text has been entered by opening the exisitng document. "
  • oWord.ActiveDocument.Save
  • oWord.Quit
  • Set oWord = Nothing
March 19th, 2015 6:46am

    Set oWord =   GetObject(  ,  "Word.Application")   
    oWord.Selection.TypeText "You can have it, I promise "
Free Windows Admin Tool Kit Click here and download it now
March 30th, 2015 4:21am

    Set oWord =   GetObject(  ,  "Word.Application")   
    oWord.Selection.TypeText "You can have it, I promise "
March 30th, 2015 8:19am

Hello,

Nice to see the Reply from you. I have done the same thing what you have suggested but unfortunately i am not achieving the result as expected.

Here i explain you clearly,

Business Scenario:

Using an aplication we will create word documents-To do this we need to fill all the document properties and click on OK button-After this,Application automatically launches a Word Document with the File name given by itself as per the Configuration and it will be available for the Editing-After user add content,he has to check in the document in the application in order to replicate the changes made by user to the document-This is the Business process

Here my Document actually resides in the Users Folder-"C:\Users\narayanasamy_r\Documentum\Checkout\" before checkin event happened,once i add content,save,close the document,i will navigate to the document in the application  and Do check-in operation.

Interesting point is that,after i do check-in operation my actual document which was resided in "C:\Users\narayanasamy_r\Documentum\Checkout\" will not be available anymore

So My logic Should be,

1.identify that particular Document from the Folder and add content,save and close(Note:i dont want to open the document from "word.application" control here, as the application itself opens up the Document)

Kindly Help On the same.

Thanks,

Narayan

Free Windows Admin Tool Kit Click here and download it now
March 31st, 2015 3:00am

Make your question short and clear.

If you make it long and complex, you will have no answer at all.

Regards

March 31st, 2015 4:18am

Ok understood,kindly Suggest the possible solution here.
Free Windows Admin Tool Kit Click here and download it now
March 31st, 2015 4:54am

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

Other recent topics Other recent topics