using a macro?

G

Geoff Cox

Hello,

I am wondering whether it is possible to edit this macro, which adds 1
hyperlink, so that I can use it to add a series of hyperlinks to a
series of .ppt file?

This on has the text "link1" and links to the file called "file1.ppt"

Can I cut and paste text into the macro so that it creates the
following?

link2 linked to file2.ppt
link3 linked to file3.ppt
link4 linked to file4.ppt

etc

Cheers

Geoff


Sub link()
'
' Macro recorded 03/04/2006 by Geoff Cox
'

End Sub
Sub linkadded()
'
' Macro recorded 03/04/2006 by Geoff Cox
'


ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Characters(Start:=1,
Length:=4).Select
ActiveWindow.Selection.TextRange.Text = "link"
With
ActiveWindow.Selection.TextRange.ActionSettings(ppMouseClick).Hyperlink
.Address = "file1.ppt"
.SubAddress = ""
.ScreenTip = ""
.TextToDisplay = "link1"
End With
ActiveWindow.Selection.TextRange.Characters(Start:=5,
Length:=0).Select
End Sub
 
J

John Wilson

Hi again!

You cant modify the macro as you want because it is applying a hyperlink to
the SELECTED item. you cant apply more than one to each item!

If you need to apply either link1 or link 2 etc to selected items you would
need to record several macros. If you explain exactly what you need to do it
may be possible to write one macro to do it ( but not to selections)
 
G

Geoff Cox

Hi again!

You cant modify the macro as you want because it is applying a hyperlink to
the SELECTED item. you cant apply more than one to each item!

If you need to apply either link1 or link 2 etc to selected items you would
need to record several macros. If you explain exactly what you need to do it
may be possible to write one macro to do it ( but not to selections)

John,

I am trying to find an easier way of adding hyperlinks such as

link1 linked to C:\foldername\file1.ppt
link2 linked to C:\foldername\file2.ppt
link3 linked to C:\foldername\file3.ppt
link4 linked to C:\foldername\file4.ppt
etc etc

to a .ppt file instead of having to add them one at a time manually.

Cheers

Geoff
 
G

Geoff Cox

This might do it for you:

Create an index or table of contents (TOC) with links to a folder full of PPT
files
http://www.rdpslides.com/pptfaq/FAQ00291.htm

Steve,

Some thing odd here! I have created the macro based on code at above
link and when I run it I do get the list of hyperlinks in the .ppt
file

but

when I run the .ppt file and click on one of the links I get an error
message "cannot open the specified file" ...

any ideas?!

Cheers

Geoff
 
G

Geoff Cox

The (not made clear) assumption is that all of the presentations will be in the
same folder - the one you're creating the index links in and the ones you're
linking to. I've updated the page to mention that and make a few other things
clearer.

Steve,

The above info fixed it!

However! I really need to be able to have the main .ppt file in one
folder and the linked ppt files in a sub-folder.

Is it difficult to change the macro code to do this? Regret I'm not
adept at creating macros...

Cheers

Geoff
 
G

Geoff Cox

On Tue, 04 Apr 2006 16:20:59 EDT, Steve Rindsberg

Steve,

The code puts each link into a separate text box.

In some cases I have 50 links so need to put them into a tabel with 5
columns (and 1 row). I don't seem to be able to move the text boxes
into the table?!

Cheers

Geoff
 
G

Geoff Cox

You can select the text from each box and paste it into a table cell.
Just tried it in 2003 and it retains the hyperlink.

Personally, I'd select all the text boxes, format them to a reasonable font
size, then select the second batch of ten, move them up to the right of the
first batch, select the third batch, move them next to the second and so on.

Steve,

Yes, I can select the text and move it into a table cell. Before I was
trying to move the text boxes themselves.

Is it possible somehow to select the text from a series of text boxes
and move this in one go? It is hard work selecting the text from each
of the text boxes!

Or could the macro put all the links, on separate lines, into just 1
text box?

I ought not to be asking you to write the code for me! Is this Visual
Basic? Any books or Net sources for writing PowrPoint macros?

Cheers

Geoff
 
G

Geoff Cox

On Wed, 05 Apr 2006 02:09:14 EDT, Steve Rindsberg

Steve,

I may have come across another problem!

I have various menu presentations, with links as I have said before,
which point to files in other folders. When I emailed a collection of
files to a colleague the links did not work!

Does this mean that PPT uses absolute paths and not relative paths?

Will the links work when I put these files onto a CD?

Does FixLinks prog come into its own here?!

Cheers

Geoff
 
G

Geoff Cox

On Wed, 05 Apr 2006 02:09:14 EDT, Steve Rindsberg

Steve,

I may have come across another problem!

I have various menu presentations, with links as I have said before,
which point to files in other folders. When I emailed a collection of
files to a colleague the links did not work!

Steve,

I have just use the "Package for CD" option in PPT 2003 to put a menu
with associated linked files in a sub folder - and that works. Do not
understand why the files I emailed did not work?

Once the above is running from the CD I do not seem able to break out
of the presentations! CTRL Z, CTRL C do not do the trick. Is there a
way of doing this?

Cheers

Geoff
 
G

Geoff Cox



Steve,

I have tried the code for putting the links in a table but I have 16
ppt files and when I created a 2 column/1 row table I get the first
ppt at the top of the left hand column and the second ppt at the top
of the right hand column - but no other ppt files appear in the
table?!

Have I missed some obvious edit I need to make in the code?

Cheers

Geoff
 
G

Geoff Cox

"First, create a table with enough cells to hold the number of files you'll be
linking to."

2 columns x 1 row is a bit short of the needed number. ;-)

Steve,

Ah! One of those very obvious ones - once pointed out! I was mislead
by the fact that I could add multiple links by hand to a 2 x 1 table.

To get the code to work with ppt files in a sub folder I changed your
code

Hyperlink.Address = "pptfiles/" & aFileNames(lPointer)

A tiny bit of my own work!!

Many thanks for all your help. You've saved me a lot of boring work!

Geoff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top