Error Cannot Open A Ms Word File Through Webspeed

konfuncio

New Member
Hi all,

We need to open a MS Word template to build a new doc file with data retrieved from my html form. To do this we use syntax like that:

<SCRIPT LANGUAGE="SpeedScript">
DEFINE VARIABLE wNomAplic AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE wNomDoc AS COM-HANDLE NO-UNDO.

CREATE "Word.Application" wNomAplic.
wNomDoc = wNomAplic:Documents:Add("C:\WebServer\plantillas\DepVen2.dot").
wNomAplic:Visible = yes.

/* code to fulfill the document */

wNomAplic:Quit( no,,).

RELEASE OBJECT wNomDoc NO-ERROR.
RELEASE OBJECT wNomAplic NO-ERROR.


as we usually do when we write .p or .w programs. Although, it doesn´t work to us through webspeed. The objects wNomAplic and wNomDoc seem to be loaded correctly, or at least we can display them, but webspeed doesn´t open the file. We are currently working in a local environment, with everything but the database remaining in my computer. Any idea of what is happening.

The webspeed log doesn´t show any relevant information anyway. It just says:

[15/10/28@12:57:47.942+0100] P-007408 T-007700 1 WS -- (Procedure: 'imprimirDeposito.r' Line:847) Error ocurrido procesando propiedad/método componente: Add.
[15/10/28@12:57:47.942+0100] P-007408 T-007700 1 WS -- (Procedure: 'imprimirDeposito.r' Line:847) Word ha detectado un problema.
[15/10/28@12:57:47.942+0100] P-007408 T-007700 1 WS -- (Procedure: 'imprimirDeposito.r' Line:847) Error: 0x80020009 imprimirDeposito.r (5890)

That means
- Error ocurred processing Add property
- Word has detected a problem.

TIA.

Alberto.

 

lee.bourne

Member
Hi,

If this is a server side process then should you not have "wNomAplic:Visible = no". You can't have the application visible on the server side, who would see it.....

Regards,

Lee

Hi all,

We need to open a MS Word template to build a new doc file with data retrieved from my html form. To do this we use syntax like that:

<SCRIPT LANGUAGE="SpeedScript">
DEFINE VARIABLE wNomAplic AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE wNomDoc AS COM-HANDLE NO-UNDO.

CREATE "Word.Application" wNomAplic.
wNomDoc = wNomAplic:Documents:Add("C:\WebServer\plantillas\DepVen2.dot").
wNomAplic:Visible = yes.

/* code to fulfill the document */

wNomAplic:Quit( no,,).

RELEASE OBJECT wNomDoc NO-ERROR.
RELEASE OBJECT wNomAplic NO-ERROR.


as we usually do when we write .p or .w programs. Although, it doesn´t work to us through webspeed. The objects wNomAplic and wNomDoc seem to be loaded correctly, or at least we can display them, but webspeed doesn´t open the file. We are currently working in a local environment, with everything but the database remaining in my computer. Any idea of what is happening.

The webspeed log doesn´t show any relevant information anyway. It just says:

[15/10/28@12:57:47.942+0100] P-007408 T-007700 1 WS -- (Procedure: 'imprimirDeposito.r' Line:847) Error ocurrido procesando propiedad/método componente: Add.
[15/10/28@12:57:47.942+0100] P-007408 T-007700 1 WS -- (Procedure: 'imprimirDeposito.r' Line:847) Word ha detectado un problema.
[15/10/28@12:57:47.942+0100] P-007408 T-007700 1 WS -- (Procedure: 'imprimirDeposito.r' Line:847) Error: 0x80020009 imprimirDeposito.r (5890)

That means
- Error ocurred processing Add property
- Word has detected a problem.

TIA.

Alberto.
 

konfuncio

New Member
Thanks for the reply, Lee.

Yes, you´re right. But I also tried saving the document to another location with

wNomDoc:SaveAs("C:\WebServer\plantillas\Deposito.doc").

and still doesn´t work.

Alberto.
 

lee.bourne

Member
Hi again, my second theory is that it will have something to do with permissions. Unfortunately I only ever use Linux boxes these days so I can't help with the specifics but my guess is that you are using IIS and that that will be running any CGI processes as a system user. It is either that that user doesn't have permissions on the template or directory or that Windows is preventing server processes from performing certain actions at all.
Regards,
Lee
 

konfuncio

New Member
That makes sense, Lee, because if I try to create a new empty file with

wNomDoc = wNomAplic:Documents:Add()

then I can display the variable wNomDoc and it´s not unknown. That means, I guess, that the Add method works properly, but I still can´t save the opened file into the mentioned folder. I checked that, and the IIS system user, which I guess is IIS_IUSRS, has permissions on the directory. It´s a matter of this, but something escapes to me... :-(

Kind regrads,
Alberto.
 

joey.jeremiah

ProgressTalk Moderator
Staff member
this should work - the free docxfactory project.

plus it's 300x times faster, works on unix/linux not just windows, supports practically every 1d and 2d barcode in the world and you could do all that with just 4 commands.

disclosure: i wrote the project.
 
Top