Solved

How do I group or reference a powerpoint table from VB

Posted on 2004-08-08
3
209 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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

757 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now