Rocket Software Homepage
Forum Home Forum Home > AccuTerm Knowledge Base (read only) > Scripting & Automation
  New Posts New Posts RSS Feed - Need to speed up Word script
  FAQ FAQ  Forum Search   Register Register  Login Login

The AccuTerm forum has moved. Go to community.rocketsoftware.com to register for the new Rocket forum.

Forum LockedNeed to speed up Word script

 Post Reply Post Reply
Author
Message
scott ballinger View Drop Down
Newbie
Newbie


Joined: October 13 2005
Location: United States
Status: Offline
Points: 22
Post Options Post Options   Thanks (0) Thanks(0)   Quote scott ballinger Quote  Post ReplyReply Direct Link To This Post Topic: Need to speed up Word script
    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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.03
Copyright ©2001-2019 Web Wiz Ltd.