Solved

How do I group or reference a powerpoint table from VB

Posted on 2004-08-08
3
220 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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
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.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

733 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