I am using ColdFusion 7 on a Windows 2003 server to talk about installing Microsoft Word 2000 by default using COM objects. The goal is to generate a document with some tables in it.
What I can do. The processor accumulates up to 100% all the time, but my code is functioning, and if it is short, it works. The problem I am facing is when the code used to create the Word document is about 25 kb + (a script generates a lot of repeating code).
After the server spends 1 minute 40 seconds trying to create a document:
- CPU load drops to 0 (CPU was split between jrun.exe for ColdFusion and winword.exe for Word 2000).
- winword.exe remains in memory.
- The ColdFusion timeout is long, so the client browser considers that the page is still processing ...
- If I kill the winword.exe process, ColdFusion immediately returns an error to the client.
Thus, these longer pages never end. I have tried many options.
- ColdFusion 8 does not work.
- Using the updated JVM for ColdFusion 7/8 does not work.
- The content of the code that I run does not matter. I do a lot of beautiful coloring, but millions of lines of "Hello world" are also dying.
- Testing Word 2007, surprisingly, really works. Formatting is a bit inconvenient, since it applies by default to Calibri and other new fonts, but the server will wait until, say, 7 minutes before it finishes. And then reboot the server, try the same code, and Word 2007 insists that it does not understand any command that I am sending. I performed a trial activation, I even started using Word 2007 using Remote Desktop after rebooting. After the first restart, Word becomes completely catatonic.
What I have not tried:
My network searches were fruitless after “here, how to connect to the Word API” on the ColdFusion land and “here, how to put the number of pages in the footer” on ASP.NET ground. Nobody using Adobe seems to be trying to do this, and nobody using Microsoft stuff has a problem. And so I rush to your shores, bleeding and exhausted, looking for some idea of this problem with an insane waiting time.
Here's what the ColdFusion code snippet looks like:
<cfset clientMatterCellStart = myDoc.Tables.Item(1).Cell(2,1)> <cfset clientMatterCellEnd = myDoc.Tables.Item(1).Cell(2,7)> <cfset clientMatterCellStart.Merge(clientMatterCellEnd)> <cfset clientMatterCellStart.Range.Font.Bold = true> <cfset clientMatterCellStart.Range.Font.Name = "Times New Roman"> <cfset clientMatterCellStart.Range.Font.Size = 14> <cfset clientMatterCellStart.Range.ParagraphFormat.Alignment = 1> <cfset clientMatterCellStart.Range.Text = "#MySubjects.subject_name[q]#"> <cfset clientMatterCellStart.Shading.BackgroundPatternColor = 13421772>
source share