Powerpoint text manipulation

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?

+3
source share
2 answers

You also need to set the action of the ActionSetting instance in HyperLink, for example. in your example:

((PowerPoint.Application)applicationObject).ActiveWindow.Selection.TextRange.ActionSettings[Microsoft.Office.Interop.PowerPoint.PpMouseActivation.ppMouseClick].Action = PpActionType.ppActionHyperlink;

+1
source

ppt , "x" (, pptx), .

, sth , ppsm, pptm,
( save as)

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

0

Source: https://habr.com/ru/post/1708075/


All Articles