views:

32

answers:

1

How could this be done?

The powerpoint application is running and the textfield i want to get the value from is on slide3.

I've tried this without any success:

Dim PPApp As PowerPoint.Application

Set PPApp = GetObject(, "PowerPoint.Application")

Range("A20").Value = PPApp.Presentation.Slide3.txtMyTextField.Value

Anyone know the right way to do this?

(Ive also added a reference to powerpoint in the excel file)

+2  A: 

This assumes I've got a single TextBox ActiveX Control on my Slide 1.

Sub GetTextBoxText()
    Dim ap As Presentation: Set ap = ActivePresentation
    Dim tb As TextBox: Set tb = sl.Shapes(1).OLEFormat.Object
    Debug.Print tb.Text
End Sub
Otaku
Thanks alot! But I may have been unclear in what i really wanted to do. It's not the regular textfields i want the text from, but the one that is accessed from the developer tab. (Textbox active x control). And it seems like those cant be handled as shapes? or am i wrong?
Noop
@Noop: Got it. I've updated the code above.
Otaku
Thanks again! I will check it out shortly.
Noop