.CopySpecial not working for Charts is SPSS V19

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

.CopySpecial not working for Charts is SPSS V19

la volta statistics

Hi

I am using SPSS 19.01 and Office 2010.  I observed that when using 'CopySpecial' in the scripting language to copy a chart, the object does not get into the clipboard. It works doing it manually, but automation seems to fail.

 

The scripting help gives for the formats [object.CopySpecial(formats)] the following parameters formats for the chart output type SPSSChart:

rtf, emf, and image

 

I tested all three of them but none of it worked. Is that a bug?

 

Christian

 

 

 

Dim objItems      As ISpssItems

Dim objItem       As ISpssItem

Dim i             As Integer

 

Set objItems = objOutput.Items

For i = 0 To objItems.Count - 1

    Set objItem = objItems.GetItem(i)

    If objItem.Visible Then

        Select Case objItem.SPSSType

            Case SPSSChart, SPSSIGraph

                PasteIntoWord objItem

        End Select

    End if

Next

 

Sub PasteIntoWord (objItem As ISpssItem)

     Clipboard ""             ' Clear

     objOutput.ClearSelection

     objItem.Selected = True

 

     objOutput.CopySpecial("emf")              'rtf, image, or emf

    ' Now the object should be in the clipboard

 

End sub

 

 

**********************************
la volta statistics

Christian Schmidhauser, Dr.phil.II
Weinbergstrasse 108
CH-8006 Zürich
Tel: +41 (043) 233 98 01
Fax: +41 (043) 233 98 02
email:
[hidden email] 
Web:
www.lavolta.ch