I was just trying to do some encoding by highlighting some of the text in PowerPoint so that I could insert a hyperlink into it. I was able to achieve this without any difficulty in Powerpoint 2003 and, to my surprise, it did not work in PowerPoint 2007 ... The code I used looks like this:
((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 someone tell me what could go wrong in the above code?
source
share