J
joel
Hi,
I'm trying to use a hypertext action setting to store hidden
information in a character of a text paragraph -- and I'm getting an
unhandled exception in some computers.
Here's how the string info is stored in a character at the beginning of
of a text paragraph:
1. PowerPoint.TextRange tr =
shape.TextFrame.TextRange.Paragraphs(i,1);
2. tr = tr.InsertBefore("_");
3. tr.ActionSettings
[PowerPoint.PpMouseActivation.ppMouseClick].Action =
PowerPoint.PpActionType.ppActionHyperlink;
4. tr.ActionSettings
[PowerPoint.PpMouseActivation.ppMouseClick].Hyperlink.Address =
"http://"+info+"/";
5. tr.Font.Superscript = Microsoft.Office.Core.MsoTriState.msoTrue;
the info is read from the paragraph as follows:
6. tr = shape.TextFrame.TextRange.Paragraphs(i,1).Characters(1,1);
7. if
(tr.ActionSettings[PowerPoint.PpMouseActivation.ppMouseClick].Action ==
PowerPoint.PpActionType.ppActionHyperlink)
8. info = tr.ActionSettings[PowerPoint.PpMouseActivation.ppMouseClick]
..Hyperlink.Address;
9. int l = info.Length;
10. info = info.Substring(7,l-8);
On some computers, the calculation in line 7 of the expression:
tr.ActionSettings[PowerPoint.PpMouseActivation.ppMouseClick].Action
raises an unhandled exception (not caught by try-catch). On other
computers, the code works fine.
Any idea what could be causing the exception?
Thanks,
Joel
I'm trying to use a hypertext action setting to store hidden
information in a character of a text paragraph -- and I'm getting an
unhandled exception in some computers.
Here's how the string info is stored in a character at the beginning of
of a text paragraph:
1. PowerPoint.TextRange tr =
shape.TextFrame.TextRange.Paragraphs(i,1);
2. tr = tr.InsertBefore("_");
3. tr.ActionSettings
[PowerPoint.PpMouseActivation.ppMouseClick].Action =
PowerPoint.PpActionType.ppActionHyperlink;
4. tr.ActionSettings
[PowerPoint.PpMouseActivation.ppMouseClick].Hyperlink.Address =
"http://"+info+"/";
5. tr.Font.Superscript = Microsoft.Office.Core.MsoTriState.msoTrue;
the info is read from the paragraph as follows:
6. tr = shape.TextFrame.TextRange.Paragraphs(i,1).Characters(1,1);
7. if
(tr.ActionSettings[PowerPoint.PpMouseActivation.ppMouseClick].Action ==
PowerPoint.PpActionType.ppActionHyperlink)
8. info = tr.ActionSettings[PowerPoint.PpMouseActivation.ppMouseClick]
..Hyperlink.Address;
9. int l = info.Length;
10. info = info.Substring(7,l-8);
On some computers, the calculation in line 7 of the expression:
tr.ActionSettings[PowerPoint.PpMouseActivation.ppMouseClick].Action
raises an unhandled exception (not caught by try-catch). On other
computers, the code works fine.
Any idea what could be causing the exception?
Thanks,
Joel