operate C# to modify PPT's hyperlink, while configuring the hyperlink's text to display attribute, the address value will be assigned as null. Anyone know this issue? Any solution?
How to reproduce the issue: 1.Create a new PPT slide in Office2010. 2. Insert a certain text/characters, such as Mircosoft blablabla, 3. Insert an URL right after the text part , TextToDisplay is the “Test”,Address is the "Url". 4. The content in the ppt is ”Microsoft Test“,here "Test" is the hyperlink which we would like to convert. Please execute the code we list below. 5. The problem will be reproduced by the above steps. PPT.Application ap = new PPT.Application(); PPT.Presentation pre = null; pre = ap.Presentations.Open(mFileName, Microsoft.Office.Core.MsoTriState.msoFalse, Microsoft.Office.Core.MsoTriState.msoFalse, Microsoft.Office.Core.MsoTriState.msoFalse); foreach (PPT.Slide mSlide in pre.Slides) { PPT.Hyperlinks links = mSlide.Hyperlinks; for (int i = 1; i <= links.Count; i++) { PPT.Hyperlink mLink = links[i]; mLink.TextToDisplay = mLink.TextToDisplay.Replace(mLink.TextToDisplay,"url"); mLink.Address = mLink.Address.Replace(mLink.Address, "url"); } } Modify texttodisplay, the address vaule will be assigned as null. Anyone knows how to solve it?
Does it caused by a PPT API's Limitation?