Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Searching Powerpoint from excel
I am attempting to search the hyperlink address of various slides on a
powerpoint master slide based on the addresses contained in Excel collumn. I have set up the necessary resources in Excel and made a start at my definitions in VB Dim PPApp As PowerPoint.Application Dim PPPres As PowerPoint.Presentation Dim PPSlide As PowerPoint.Hyperlink.Address Now, I know how, on the Powerpoint, thanks to some excellent help on the Powrpoint forum, to search and change the hyperlink.address object in Powerpoint: For Each s In ActivePresentation.Slides For Each h In s.Hyperlinks tip = h.ScreenTip h.Address = Replace(h.Address, OldUrl, NewUrl) h.ScreenTip = tip h.ScreenTip = Replace(h.ScreenTip, OldUrl, NewUrl) Next Next What I need is how to open the relevant powerpoint file, search on a value from a collumn and return some sort of message saying that it was or was not found. Not much to ask for :( If anyone can give me a clue, I would greatly appreciate it. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Searching Powerpoint from excel
Hello there,
I am going to go with the assumption that you have referenced the appropriate version of PowerPoint in the VBE (Alt + F11) | Tools | References section. You may be able to use something like this ... Option Explicit Sub PowerPointTesting() 'assumes a reference has been set to: 'Microsoft PowerPoint xx.0 Object Library 'where xx is your version number Dim PPApp As PowerPoint.Application Dim PPPres As PowerPoint.Presentation Dim PPSlide As PowerPoint.Slide '.Hyperlink.Address Dim h As PowerPoint.Hyperlink, s As PowerPoint.Slide Dim fName As String, OldUrl As String, NewUrl As String Dim tip '** ---------------------------------------------------- ** fName = "C:\Documents and Settings\Rob\Desktop\test.ppt" '** ---------------------------------------------------- ** Set PPApp = CreateObject("PowerPoint.Application") PPApp.Visible = True Set PPPres = PPApp.Presentations.Open(fName) For Each s In PPPres.Slides 'ActivePresentation.Slides For Each h In s.Hyperlinks tip = h.ScreenTip h.Address = Replace(h.Address, OldUrl, NewUrl) h.ScreenTip = tip h.ScreenTip = Replace(h.ScreenTip, OldUrl, NewUrl) Next Next 'optional--- PPPres.Close PPApp.Quit '----------- Set PPApp = Nothing Set PPPres = Nothing Set PPSlide = Nothing Set s = Nothing Set h = Nothing End Sub Still not sure what your OldUrl and NewUrl are, or how they are defined. I dimensioned them as Strings, only because I was unsure of their nature, it wasn't specified. This could be a starter for you. It works for me. HTH, and regards, Zack Barresse "jimr" wrote in message ... I am attempting to search the hyperlink address of various slides on a powerpoint master slide based on the addresses contained in Excel collumn. I have set up the necessary resources in Excel and made a start at my definitions in VB Dim PPApp As PowerPoint.Application Dim PPPres As PowerPoint.Presentation Dim PPSlide As PowerPoint.Hyperlink.Address Now, I know how, on the Powerpoint, thanks to some excellent help on the Powrpoint forum, to search and change the hyperlink.address object in Powerpoint: For Each s In ActivePresentation.Slides For Each h In s.Hyperlinks tip = h.ScreenTip h.Address = Replace(h.Address, OldUrl, NewUrl) h.ScreenTip = tip h.ScreenTip = Replace(h.ScreenTip, OldUrl, NewUrl) Next Next What I need is how to open the relevant powerpoint file, search on a value from a collumn and return some sort of message saying that it was or was not found. Not much to ask for :( If anyone can give me a clue, I would greatly appreciate it. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel-Powerpoint | Charts and Charting in Excel | |||
Searching, matching then searching another list based on the match | Excel Discussion (Misc queries) | |||
excel to powerpoint | Excel Worksheet Functions | |||
EXCEL AND POWERPOINT | New Users to Excel | |||
excel, powerpoint | Excel Discussion (Misc queries) |