Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel-Powerpoint Denver Charts and Charting in Excel 1 June 21st 09 10:57 AM
Searching, matching then searching another list based on the match A.S. Excel Discussion (Misc queries) 1 December 13th 06 05:08 AM
excel to powerpoint confused Excel Worksheet Functions 1 October 5th 05 05:40 PM
EXCEL AND POWERPOINT CANDELYN. CARPENTER New Users to Excel 2 May 12th 05 01:10 PM
excel, powerpoint srm Excel Discussion (Misc queries) 1 January 16th 05 03:40 AM


All times are GMT +1. The time now is 09:36 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"