Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Wscript stopped working

Status
Not open for further replies.

Dovdov

Technical User
Feb 22, 2012
1
IL
Hi

I have been using the following script to open an existing word document, and merge fields into it, save the document and open it for editing.

It has been working for years, but suddenly last week it stopped working on one computer. The spec is, windows 7; office 2010. It was working the previous day but now does not execute.

I have checked that the network paths are connected.

Could anyone throw some light on this?

Thank you for your help.

Dov


Dim atBindingValues(6)
Dim atBindingNames(6)
atBindingValues(1)="26/08/2012"
atBindingNames(1)="<<__Field1__>>"
atBindingValues(2)="Mrs Barker"
atBindingNames(2)="<<__Field2__>>"
atBindingValues(3)="15 High Street "
atBindingNames(3)="<<__Field3__>>"
atBindingValues(4)="L22/160/15"
atBindingNames(4)="<<__Field4__>>"
atBindingValues(5)="15 High Street, Lancashire"
atBindingNames(5)="<<__Field5__>>"
atBindingValues(6)="Mrs Susan Barker"
atBindingNames(6)="<<__Field6__>>"
Set WordApp = GetObject("", "Word.Application")
Set NewDocument = WordApp.Documents.Add ("\\192.168.0.100\docs\templates\BLANK TENANT.doc", False, wdNewBlankDocument )
Set F =NewDocument.ActiveWindow.Selection.Find
f.ClearAllFuzzyOptions
for index=1 to 6
f.Execute atBindingNames(index), false, false, false, false, false, true, wdFindContinue, false, atBindingValues(index), 2
next
NewDocument.SaveAs "\\192.168.0.100\docs\0000000044\9\0000006119\9\0000043189.doc"
WordApp.Visible=true
WordApp.WindowState=1
Set objFileSys=CreateObject("Scripting.FileSystemObject")
set demofile=objFileSys.GetFile("C:\Users\administrator\AppData\Roaming\Work\Script26-08-201208-47-186482.vbs")
demofile.Delete
Set objFileSys=Nothing
set demofile=Nothing
 
 
Are you getting an error? What's the error? What line is the error occurring on?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top