views:

389

answers:

1

Hi, I was just trying to do some coding on highlighting a portion of text in PowerPoint so that I could insert a hyperlink to it. I could achieve it without any difficulty in Powerpoint 2003 and to my surprise, it did not work in PowerPoint 2007... The code that I used is as follows :

((PowerPoint.Application)applicationObject).ActiveWindow.Selection.TextRange.Text = "PPT";
((PowerPoint.Application)applicationObject).ActiveWindow.Selection.TextRange.Select();
((PowerPoint.Application)applicationObject).ActiveWindow.Selection.TextRange.ActionSettings[Microsoft.Office.Interop.PowerPoint.PpMouseActivation.ppMouseClick].Hyperlink.Address = "http://www.google.com";
((PowerPoint.Application)applicationObject).ActiveWindow.Selection.Unselect();

Can anyone tell me what could have gone wrong in the above code?

A: 

You should save your ppt app like an app with macro's, if it ends on 'x' (like pptx) you cannot run macros.

So save as sth with macro support like ppsm, pptm,
(use save as)

see : http://msdn.microsoft.com/en-us/library/aa433259.aspx

Peter
No peter i tried that too its not working :( ...the same code is working in 2003 but why not in 2007...pls can anyone help me sort this..
Can anyone help me to solve this :(
Anyone there to throw light on this :(