Solved

How do I group or reference a powerpoint table from VB

Posted on 2004-08-08
3
219 Views
Last Modified: 2010-05-18
I am creating a powerpoint slide from my application.  At one point I add a table and then want to populate the cells.  I need to know how to name the table, or group it with a name so that I can select it to populate it.  My code looks something like the code below ( this was generated from a macro in powerpoint, so I just need to know how to get the name like "group 142") .

        oSlide.Shapes.AddTable(11, 5, 358, 28, 300, 500)

        oApp.ActiveWindow.Selection.SlideRange.Shapes("Group 142").Select()
        oApp.ActiveWindow.Selection.ShapeRange.GroupItems(Index:=54).TextFrame.TextRange.Characters(Start:=1, Length:=0).Select()

Thanks in advance for your help.
0
Comment
Question by:spmcmorrow
  • 2
3 Comments
 
LVL 4

Accepted Solution

by:
Daniellus83 earned 350 total points
ID: 11751290
Sir,

Its not very easy to find your table,.. but one way to do it is this:

----------------------------------------------------------------------------------------------------------------------------------
    ActivePresentation.Slides(1).Shapes.AddTable NumRows:=3, NumColumns:=4, Left:=10, Top:=10, Width:=288, Height:=288
 
    With ActivePresentation.Slides(1)
      For sh = 1 To .Shapes.Count
          If .Shapes(sh).HasTable Then
             
              'You can directly edit the found table...
             
              MsgBox (.Shapes(sh).Name) '..or store its name?
             
        End If
      Next
    End With
----------------------------------------------------------------------------------------------------------------------------------

This code now returns a MSGBOX with the name...

If you want to expand this for more slides, just use a for-loop for the sildes(.)


Succes,... Daniël
0
 
LVL 4

Expert Comment

by:Daniellus83
ID: 11797187
Did this last code work out??
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question