Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

powerpoint presentation instantiated by VB6 unable to set hyperlinks 1

Status
Not open for further replies.

psykoProgrammer

Programmer
Dec 15, 2004
16
CA
I have an Access db, and a custom VB6 user interface for interactions. The user wants to click a generate button, and have a powerpoint presentation automatically built based on details within the database. This works fine...and am quite pleased with the results! But, the user wants hyperlinking added to the slideshow. I've seen ways of doing this where you point to websites and/or other programs, but what they really want is to have a word on a slide jump to another slide within the same generated presentation. I can do this manually (setting hyperlink, go to slide n), but have yet to manage to accomplish it during the building of the presentation.

Any ideas, code snippets to figure out how to set the linking/navigating from one page to another? I'm at my wits end with this one!

I could attach code if it helps, but i'm not sure that it would as it simply shows how the pages are generated, and not how hyperlinking is actually performed ('cause i can't figure that out!).

Thanks in advance!
 
Hi,
when you are in PP, try to record macro when creating a hyperlink. This can help to find objects and properties involved.
For me (office xp) worked SubAddress property with a string (pseudocode):
"SlideID, Number, SlideName"

The most important is SlideID value, which is fixed and unique for a given slide and can be read by SlideID property of slide object. The rest can be any, but the whole has to have three sections separated by commas.

BTW, there is a separate VBA forum (707), where it is easier find answers connected with ms office programming.

combo
 
Ah, the 3 parameters you indicated were ever so nice. I hadn't found anything indicating all three before, and had tried something along the lines of .subaddress using just a single "Slide n" value to no avail. This may come in handy!

Sorry about not placing this in the right forum; is there any way to move it now that i've posted the thread, and there are additional posts to it? I'll know better for next time. :)

Oh, one other thing that may cause some grief: I tried running a macro to see what snippet would be generated, and that works fine. The trouble is, when generating the code through the VB interface, the powerpoint presentation is not actually the activewindow. What object would i have to set in order for a as-yet invisible, non-active, presentation to be the ActiveWindow?

Thanks again!
 
Hi,
first of all, thanks for the star.
AFAIK, there is no way to move the thread to another forum.
I haven' tested that, but if you create a shape and have a handle to it, it is enough to (ShapeRef is shape name here):

With ShapeFef.ActionSettings(ppMouseClick).Hyperlink
...
End With

I do not like to work with ActiveWindow, rather use Slide object and Shapes property to get a shape. You can also name the shape (Name property) and refer to shape via ... .Shapes("ShapeName").
Hope that this will be helpful.

combo
 
Thanks for all of the help, Combo!

The star was well deserved; i could not have moved on without the aid you have given me. I tried a few dozen web sites to no avail with this problem, and was unable to find any documentation to explain how to do this (hyperlinks to websites and other programs no problem, but not jumping directly to a specified slide!). I couldn't find anything similar on this site, but thought enough of it to join and ask for aid. I'm so glad i did! This has been an invaluable experience for me, and i can't wait to help out others to repay the favor.

Thanks again.
 
Amazing! I just tried it, and within a few seconds it was all but done!

This little program generates some fairly robust presentations by pulling data from the db, and populating grids, arrows, etc, etc, throughout a massive presentation (4 slides per project, 21 projects in db). The user wanted to "dig deeper" into the details of a given project if the audience was keen on a project in question, but allow the demonstrator to skip over the details if the crowd had no such involvement. With the knowledge of 3 variables being passed to the subaddress property it was easy enough to do...again...thanks to you!

Code:
oPPPres.Slides(lSlideCtr - 3).Shapes(11).ActionSettings(ppMouseClick).Hyperlink.SubAddress = oPPPres.Slides(lSlideCtr - 2).SlideID & "," & lSlideCtr - 2 & ",Slide " & lSlideCtr - 2

Of course, i've left out the bulk of the code, and reduced the flexibility of the program (for ease of understanding should someone else be looking for such a snippet). This should be enough to give a fairly good idea as to what you can do, and how to go about doing it.

The star just isn't enough to belay how truly pleased i am that this has come together. Thank you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top