Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Trying To Store Shapes/Objects to an array ??

getfromclipboard only works with text strings.

You can create a reference to the existing object,

Sub Test()
Dim MyObj(1 to 54) As Object
Dim X As Integer
For X = 1 To 54
With Presentations(1).Slides(X)
.Select
.Shapes(1).Select
Set MyObj(X) = .Shapes(1)
End With
Next X
End Sub

--
Regards,
Tom Ogilvy


"Dan Thompson" wrote in message
...
My question relates more to powerpoint so I apologize for posting it here
its just that there is no powerpoint vba programing news group available
that I could find, and as my question pertains more realy to vba I figured

I
would post here.

I am trying to have vba go through multiple slides and copy the objects

from
each slide into elements of an array so that I can use vba to call the

shapes
stored in my object array programaticly.

here is the code I have have tried but I keep getting an error.

Sub Test()
Dim MyObj(54) As Object
Dim X As Integer
For X = 1 To 54
With Presentations(1).Slides(X)
.Select
.Shapes(1).Select
End With
ActiveWindow.Selection.Copy
Set MyObj(X) = MyObj(X).GetFromClipboard(1) 'This is the line I am
getting errors
Next X
End Sub

Now I relize that the "GetFromClipboard" Method probably only works for

data
stored on the windows clipboard. Is there another method that will do the
same thing as "GetFromCipboard" Method ?, but for objects like PowerPoint
shapes or pictures ?

Any Ideas out there would be most welcom

Thanks
Dan Thompson.





  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 125
Default Trying To Store Shapes/Objects to an array ??

Thanks Tom your code will work for storing my shape objects to my object array.
However how can I access them once they are stored in my object array, In
order to
copy them to a new blank slide for example

Presentations(1).slides(55).shapes(MyObj(4).paste
Im sure the above line is incorect but gives you an Idea of what I am trying
to accomplish any thoughts ?

Dan.

"Tom Ogilvy" wrote:

getfromclipboard only works with text strings.

You can create a reference to the existing object,

Sub Test()
Dim MyObj(1 to 54) As Object
Dim X As Integer
For X = 1 To 54
With Presentations(1).Slides(X)
.Select
.Shapes(1).Select
Set MyObj(X) = .Shapes(1)
End With
Next X
End Sub

--
Regards,
Tom Ogilvy


"Dan Thompson" wrote in message
...
My question relates more to powerpoint so I apologize for posting it here
its just that there is no powerpoint vba programing news group available
that I could find, and as my question pertains more realy to vba I figured

I
would post here.

I am trying to have vba go through multiple slides and copy the objects

from
each slide into elements of an array so that I can use vba to call the

shapes
stored in my object array programaticly.

here is the code I have have tried but I keep getting an error.

Sub Test()
Dim MyObj(54) As Object
Dim X As Integer
For X = 1 To 54
With Presentations(1).Slides(X)
.Select
.Shapes(1).Select
End With
ActiveWindow.Selection.Copy
Set MyObj(X) = MyObj(X).GetFromClipboard(1) 'This is the line I am
getting errors
Next X
End Sub

Now I relize that the "GetFromClipboard" Method probably only works for

data
stored on the windows clipboard. Is there another method that will do the
same thing as "GetFromCipboard" Method ?, but for objects like PowerPoint
shapes or pictures ?

Any Ideas out there would be most welcom

Thanks
Dan Thompson.






  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Trying To Store Shapes/Objects to an array ??

MyObject(4).copy

I would assume

--
Regards,
Tom Ogilvy


"Dan Thompson" wrote in message
...
Thanks Tom your code will work for storing my shape objects to my object

array.
However how can I access them once they are stored in my object array, In
order to
copy them to a new blank slide for example

Presentations(1).slides(55).shapes(MyObj(4).paste
Im sure the above line is incorect but gives you an Idea of what I am

trying
to accomplish any thoughts ?

Dan.

"Tom Ogilvy" wrote:

getfromclipboard only works with text strings.

You can create a reference to the existing object,

Sub Test()
Dim MyObj(1 to 54) As Object
Dim X As Integer
For X = 1 To 54
With Presentations(1).Slides(X)
.Select
.Shapes(1).Select
Set MyObj(X) = .Shapes(1)
End With
Next X
End Sub

--
Regards,
Tom Ogilvy


"Dan Thompson" wrote in message
...
My question relates more to powerpoint so I apologize for posting it

here
its just that there is no powerpoint vba programing news group

available
that I could find, and as my question pertains more realy to vba I

figured
I
would post here.

I am trying to have vba go through multiple slides and copy the

objects
from
each slide into elements of an array so that I can use vba to call the

shapes
stored in my object array programaticly.

here is the code I have have tried but I keep getting an error.

Sub Test()
Dim MyObj(54) As Object
Dim X As Integer
For X = 1 To 54
With Presentations(1).Slides(X)
.Select
.Shapes(1).Select
End With
ActiveWindow.Selection.Copy
Set MyObj(X) = MyObj(X).GetFromClipboard(1) 'This is the line I

am
getting errors
Next X
End Sub

Now I relize that the "GetFromClipboard" Method probably only works

for
data
stored on the windows clipboard. Is there another method that will do

the
same thing as "GetFromCipboard" Method ?, but for objects like

PowerPoint
shapes or pictures ?

Any Ideas out there would be most welcom

Thanks
Dan Thompson.








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Store array ??? piero Excel Worksheet Functions 4 September 16th 09 04:39 PM
Advanced formatting symbols/shapes objects RLang Excel Discussion (Misc queries) 0 May 16th 08 02:25 PM
Can one store a string in a Array element? [email protected] Excel Discussion (Misc queries) 1 April 17th 07 12:53 PM
Shapes Range Array Bubb Excel Discussion (Misc queries) 1 April 10th 06 11:51 PM
Selecting drawing objects or shapes in a macro John DeFiore Excel Programming 3 October 13th 03 02:26 PM


All times are GMT +1. The time now is 04:20 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"