Print Page | Close Window

Need to speed up Word script

Printed From: Rocket Software
Category: AccuTerm Knowledge Base (read only)
Forum Name: Scripting & Automation
Forum Description: Customize and control AccuTerm using scripts and automation
URL: https://forum.asent.com/forum_posts.asp?TID=2694
Printed Date: March 26 2026 at 8:51pm
Software Version: Web Wiz Forums 12.03 - http://www.webwizforums.com


Topic: Need to speed up Word script
Posted By: scott ballinger
Subject: Need to speed up Word script
Date Posted: August 29 2018 at 3:03pm
I have a Universe site where I use the following Accuterm script to convert a DOCX file into a PDF using Word. The script is executed repeatedly against a list of DOCX files (sometimes thousands).

SCR = ""
SCR<-1> = 'Set WordApp = CreateObject("Word.Application")'
SCR<-1> = 'On Error Resume Next' ;* per PJS 05-30-18
SCR<-1> = 'WordApp.Documents.Open(FileName:="':DOS.PATH:DOCUMENT:'", ReadO nly:=True)'
SCR<-1> = 'If Err Then Exit Sub' ;* per PJS 05-30-18
SCR<-1> = 'WordApp.ActiveDocument.ExportAsFixedFormat OutputFileName:="':D
OS.PATH:DOC.PDF:'", '
SCR     := 'ExportFormat:=17, OpenAfterExport:=False, OptimizeFor:=0, '
SCR     := 'Range:=0, From:=1, To:=99, '
SCR     := 'Item:=0, IncludeDocProps:=True, KeepIRM:=True, '
SCR     := 'CreateBookmarks:=0, DocStructureTags:=True, '
SCR     := 'BitmapMissingFonts:=True, UseISO19005_1:=True'
SCR<-1> = 'WordApp.ActiveDocument.Close False'
SCR<-1> = 'WordApp.Quit'
SCR<-1> = 'Set WordApp = Nothing'
SCR<-1> = 'Set WordDoc = Nothing'

CONVERT @AM TO CHAR(25) IN SCR ;* EM character

PRINT CHAR(27):CHAR(2):'P':SCR:CHAR(13):

This works fine and is very reliable. However on my old Windows 7 PC it runs at about 2 seconds per document. On a new Windows 10 PC (that the client purchased explicitly to run this job) it runs much slower, about 6 seconds per document. (?) Both PCs are running Accuterm 7.2a.

The faster Windows 7 PC is a DELL i7-4790 dual core CPU @ 3.60GHz with 8GB of RAM.

The slower Windows 10 PC is an HP AMD PRO A12-9800 quad core CPU @ 3.80GHz with 16GB of RAM.

Is it possible that the 3x performance difference is due to the different CPUs? You would think that the AMD is faster from the specs, but PassMark CPU benchmarks rate the Intel i7 at 9952 vs the AMD at 6199.

Or is is possible that Windows 7 is just that much faster than Windows 10 when launching and running Word repeatedly? Any suggestions re: CPU for a new PC to host this application?

Thanks,
/Scott



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.03 - http://www.webwizforums.com
Copyright ©2001-2019 Web Wiz Ltd. - https://www.webwiz.net