K
kimkom
Hi all,
I'm have trouble with the macro below not working on a consistant basis.
What it attempts to do is extract text from a Text Box (ActiveX) from one
slide and copy it to a table cell on another slide.
My feeling is that the problem may lie with the variable "TheText(oSh)" but
as I'm a vba newbie I'm unable to figure out a work around.
Can anyone assist please?
Thanks,
Michael
Sub UpdatePrintTables()
Dim oSh As Shape
Dim oTarget_table1 As Table
Dim oTarget_table2 As Table
Set oTarget_table1 =
ActivePresentation.Slides(3).Shapes("PrintTable1").Table
Set oTarget_table2 =
ActivePresentation.Slides(3).Shapes("PrintTable2").Table
For Each oSh In ActivePresentation.Slides(2).Shapes
If oSh.Name = "EditableBox1" Then
oTarget_table1.Cell(1, 2).Shape.TextFrame.TextRange.Text =
TheText(oSh)
oTarget_table2.Cell(1, 2).Shape.TextFrame.TextRange.Text =
TheText(oSh)
End If
If oSh.Name = "EditableBox2" Then
oTarget_table1.Cell(1, 7).Shape.TextFrame.TextRange.Text =
TheText(oSh)
oTarget_table2.Cell(1, 7).Shape.TextFrame.TextRange.Text =
TheText(oSh)
End If
Next
ActivePresentation.SlideShowWindow.View.GotoSlide 3
End Sub
I'm have trouble with the macro below not working on a consistant basis.
What it attempts to do is extract text from a Text Box (ActiveX) from one
slide and copy it to a table cell on another slide.
My feeling is that the problem may lie with the variable "TheText(oSh)" but
as I'm a vba newbie I'm unable to figure out a work around.
Can anyone assist please?
Thanks,
Michael
Sub UpdatePrintTables()
Dim oSh As Shape
Dim oTarget_table1 As Table
Dim oTarget_table2 As Table
Set oTarget_table1 =
ActivePresentation.Slides(3).Shapes("PrintTable1").Table
Set oTarget_table2 =
ActivePresentation.Slides(3).Shapes("PrintTable2").Table
For Each oSh In ActivePresentation.Slides(2).Shapes
If oSh.Name = "EditableBox1" Then
oTarget_table1.Cell(1, 2).Shape.TextFrame.TextRange.Text =
TheText(oSh)
oTarget_table2.Cell(1, 2).Shape.TextFrame.TextRange.Text =
TheText(oSh)
End If
If oSh.Name = "EditableBox2" Then
oTarget_table1.Cell(1, 7).Shape.TextFrame.TextRange.Text =
TheText(oSh)
oTarget_table2.Cell(1, 7).Shape.TextFrame.TextRange.Text =
TheText(oSh)
End If
Next
ActivePresentation.SlideShowWindow.View.GotoSlide 3
End Sub