All,
I recently linked my database up to my company's host system via ODBC. The result is the ability to query on real time data, which rocks. As I do more and more with it, I keep thinking how cool it would be to link that to a continuously looping presentation to display around my facility. Unfortunately, I have basically scoured the internet seeking a way to link an Access query to a powerpoint text box. The thought was:
1) Set up MS Access query
2) Link to text box
3) set up macro to refresh data
I laugh at how foolish I was thinking it would be that simple. So now I'm stuck. I keep running into the snippet of code but it's either too dated or I'm and idiot and can't get it to work right:
Code:
Sub Export2Powerpoint(filePath as string, title as string)
Dim ppApp As PowerPoint.Application
Dim ppPres As PowerPoint.Presentation
Dim ppCurrentSlide As PowerPoint.Slide
Set ppApp = CreateObject("PowerPoint.Application", "")
ppApp.Visible = True
Set ppPres = ppApp.Presentations.Open(filePath) ' filePath is the path to the PowerPoint template file
Set ppCurrentSlide = ppPres.Slides(1)
ppCurrentSlide.Shapes("Title").TextFrame.TextRange.Text = title
ppCurrentSlide.Shapes("MyName").TextFrame.TextRange.Text = "My exported text"
Set ppApp = Nothing
Set ppPres = Nothing
Set ppCurrentSlide = Nothing
Does anyone have any thoughts or suggestions on how I should approach this? I'm a code novice so basically all I can do is piece together prewritten code.
Thanks,
Bill