Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

VB Loops and Names

6 views
Skip to first unread message

Jens T. Karst

unread,
Jun 7, 2000, 3:00:00 AM6/7/00
to
Hello,
I have this 2 problems:
I want to go through a loop with the for- next loop for every object an
my slide. If I record a macro I get an array of all object named like
this ("Rectangle10", "picture 5"...). Due to the circumstance that the
count of the object differs from slide to slide I could not name them.

2.) I want to know the code for Selecting every Rectangle (or may be
"picture" or somewhat) on one determined slide

Not to hard, ain't
Thanks for that Jens

karstj.vcf

Brian Reilly, MVP

unread,
Jun 7, 2000, 3:00:00 AM6/7/00
to
Jens, This should give you a start
Should even be a good example for Friday and crowd, Steve.
Sorry about the changes in the line breaks here.

Sub Object_Types_on_This_Slide()
'Refers to each object on the current page and returns the
Shapes.Type
'Can be very useful when searching through all objects on a page
Dim it As String
Dim i As Integer
'''''''''''''''''
'Read-only Long
'''''''''''''''''

For i = 1 To ActiveWindow.Selection.SlideRange.Shapes.Count
'No need to select the object in order to use it
With ActiveWindow.Selection.SlideRange.Shapes(i)
'But it is easier to watch when the object is selected
'This next line is for demonstration purposes only. It is
'not necessary
ActiveWindow.Selection.SlideRange.Shapes(i).Select
''''''''''''''''''''''''
Select Case .Type
Case msoAutoShape 'Type 1
it = "an AutoShape"
Case msoCallout 'Type 2
it = "a Callout"
Case msoChart 'Type 3
it = "a Chart"
Case msoComment 'Type 4
it = "a Comment"
Case msoFreeform 'Type 5
it = "a Freeform"
Case msoGroup 'Type 6
it = "a Group"
Case msoEmbeddedOLEObject 'Type 7
it = "an Embedded OLE Object"
Case msoFormControl 'Type 8
it = "a Form Control"
Case msoLine 'Type 9
it = "a Line"
Case msoLinkedOLEObject 'Type 10
it = "a Linked OLE Object"
With .LinkFormat
MsgBox (.SourceFullName)
End With
Case msoLinkedPicture 'Type 11
it = "a Linked Picture"
With .LinkFormat
MsgBox (.SourceFullName)
End With
Case msoOLEControlObject 'Type 12
it = "an OLE Control Object."
Case msoPicture 'Type 13
it = "a embedded picture."
Case msoPlaceholder 'Type 14
it = "a text placeholder (title or regular
text--not a standard textbox) object."
Case msoTextEffect 'Type 15
it = "a WordArt (Text Effect)."
Case msoMedia 'Type 16
it = "a Media object .. sound, etc."
With .LinkFormat
MsgBox (.SourceFullName)
End With
Case msoTextBox 'Type 17
it = "a Text Box"
Case msoScriptAnchor 'Type # not
checked
it = " a ScriptAnchor"
Case msoTable
it = " a Table" 'Type 19
Case msoShapeTypeMixed 'Type # not
checked
it = "a Mixed object (whatever that might be)."
Case Else 'Just in
case
it = "a mystery!!! ?An undocumented object type?"
& _
" Haven't found one of these yet"
End Select
MsgBox ("I'm " & it & " Type is # " & .Type)
End With
Next i
End Sub


Brian Reilly, PowerPoint MVP

On Wed, 07 Jun 2000 12:11:57 +0200, "Jens T. Karst"
<kar...@hpmedica.com> wrote:

>Dies ist eine mehrteilige Nachricht im MIME-Format.
>--------------65BCCB84E6F4AA1CDA317412
>Content-Type: text/plain; charset=us-ascii
>Content-Transfer-Encoding: 7bit

>--------------65BCCB84E6F4AA1CDA317412
>Content-Type: text/x-vcard; charset=us-ascii;
> name="karstj.vcf"
>Content-Transfer-Encoding: 7bit
>Content-Description: Visitenkarte für Jens T. Karst
>Content-Disposition: attachment;
> filename="karstj.vcf"
>
>begin:vcard
>n:Karst;Jens T.
>tel;fax:0241/85630
>tel;work:0241/85620
>x-mozilla-html:FALSE
>adr:;;;;;;
>version:2.1
>email;internet:kar...@hpmedica.com
>fn:Jens T. Karst http://mitglied.tripod.de/jkarst/index.HTM
>end:vcard
>
>--------------65BCCB84E6F4AA1CDA317412--
>


Steve Rindsberg

unread,
Jun 7, 2000, 3:00:00 AM6/7/00
to
Consider it Fridayfied.

--
Steve Rindsberg, PowerPoint MVP
PPT FAQ - http://www.rdpslides.com/pptfaq
RnR PPTools - http://www.rdpslides.com/pptools
ZAP! for service bureaus - http://www.rdpslides.com/zap

Brian Reilly, MVP <reilly_and...@compuserve.com> wrote in message
news:393e29b7...@msnews.microsoft.com...

0 new messages