inserting images in a table

harisyam

New member
Local time
Today, 03:04
Joined
Oct 10, 2014
Messages
2
hello all

I'm new to vba programming and i've written a code which will insert a table in the current slide now i want to insert pictures in the cells of the table how can i do that?

this is my code:
Sub NativeTable()
Dim pptSlide As Slide
Dim pptShape As Shape ' code from google to create a table
Dim pptPres As presentation
Dim iRow As Integer
Dim iColumn As Integer
Dim oShapeInsideTable As Shape
Set pptPres = ActivePresentation
With pptPres
Set pptSlide = .Slides.Add(.Slides.Count, ppLayoutBlank)
End With
With pptSlide.Shapes
Set pptShape = .AddTable(NumRows:=3, NumColumns:=5, Left:=30, _
Top:=110, Width:=660, Height:=320)
End With
With pptShape.Table
For iRow = 1 To .Rows.Count
For iColumn = 1 To .Columns.Count
With .Cell(iRow, iColumn).Shape.TextFrame.TextRange
.Text = "Sample text in Cell"
With .Font
.Name = "Verdana"
.Size = "14"
End With
End With
Next iColumn
Next iRow
End With
End Sub
 
thanks Rx_, i'll be working on the code you provided in the link. thanks a lot for your help
 

Users who are viewing this thread

Back
Top Bottom