Solved

How do I group or reference a powerpoint table from VB

Posted on 2004-08-08
3
226 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
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're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

696 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