Save *.SPO (output) as Multiple *.doc

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Save *.SPO (output) as Multiple *.doc

Ben Cohen
Dear SPSS Users:

Using the technique described below, I have successfully written an RTF
file to c:\temp from SPSS. Next, I would like to use the same SCRIPT
within a Macro to produce an output file for each of several program
sites. Thus, each time the Macro loops, I would like a *.doc file created
with a different *.doc name for each site.  How is this possible?

Thank you,

BC



On Wed, 27 Jul 2005 17:01:47 +0200, Rodriguez, Aryelly [LFSGB]
<[hidden email]> wrote:

>Vishal
>
>Thanks very much for your answer. These scripts kind of solve my problem
>but the final file is a htm, so I need to go to the file's final locations
>and eliminate the .htm from their names in order to obtain the desired
files

>
>(I think that my main problem is the version of SPSS)
>
>One again many thanks
>
>Kind Regards
>
>Aryelly R.
>
>-----Original Message-----
>From: SPSSX(r) Discussion [mailto:[hidden email]]On Behalf Of
>Vishal Dave
>Sent: 27 July 2005 15:25
>To: [hidden email]
>Subject: Re: Save *.SPO (output) as *.doc or *.rtf using syntax/script
>
>
>Aryelly,
>
>You have to use script for exporting the files to *.Doc and *.Rtf
>format.  Run the following script for Output file.
>
>************.Doc:
>Sub Main
>'To export all visible items of the Designated Output Viewer to XML:
>Call objSpssApp.GetDesignatedOutputDoc.ExportDocument(SpssVisible, _
>        "c:\temp\spssoutput.doc", SpssFormatDoc, False)
>End Sub
>
>*********.rtf
>Sub Main
>'To export all visible items of the Designated Output Viewer to XML:
>Call objSpssApp.GetDesignatedOutputDoc.ExportDocument(SpssVisible, _
>        "c:\temp\spssoutput.rtf", SpssFormatRtf, False)
>End Sub
>
>************
>You can call the script from syntax by SCRIPT command.  If you are
>saving above scripts as "C:\temp\script1.sbs" and "C:\temp\script2.sbs"
>then you can call them in the scripts by command :
>
>*Syntax for output generation comes here*
>SCRIPT "C:\temp\script1.sbs".
>SCRIPT "C:\temp\script2.sbs".
>
>Hope this helps,
>Vishal.
>
>
>-----Original Message-----
>From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
>Rodriguez, Aryelly [LFSGB]
>Sent: Wednesday, July 27, 2005 9:05 AM
>To: [hidden email]
>Subject: Save *.SPO (output) as *.doc or *.rtf using syntax/script
>
>I wonder if someone could help me. I would like to know if it is
>possible to
>save SPSS
>output (*.spo files) as *.doc or *.rtf in an automatic way using
>syntax/script.
>I have followed the recommendations of Mr. Raynald Levesque in his
>website
>(http://www.spsstools.net/)
>but what I have managed to do is to export the output file to MS Word or
>toggle to "Draft Output" before
>my main calculations are performed, in both cases I had to save the
>*.doc /
>*.rtf files manually .
>
>Kind Regards
>
>PS: Who ever has the kindness to answer my question, would like to know
>that
>my SPSS is v 10.1.3
>
>> Aryelly Rodriguez
>>

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD