Ok so that is working fairly well as far as reading text, however the links are still an issue. Attached is the PPT i am using for testing and below is the test code. There are two links in the PPT. One for internal link and one for an external link. Running the code the first link(internal) appears to show expected information. The second link(external) does not show expected information. I am using a winforms app and simply displaying all the text in a text box.
This may answer your question. Since there was some confusion from the original post about where text was located I was not seeing what I thought should be seen concerning links. So I was trying to access the links property from other objects such as Paragraph and Portions to see if they had the actual link information.
There also seems to be a diferent layer of information depending on how a shape is cast. For example if the shape is cast to a VideoFrame it shows the file link information, but the link does not show in the code below.
private string ProcessLink(Link link, int shapeid, int linkid) {
string text = "";
text += "Shape.TextFrame[" + shapeid + "].Links[" + linkid + "].Begin: " + link.Begin + "\r\n";
text += "Shape.TextFrame[" + shapeid + "].Links[" + linkid + "].End: " + link.End + "\r\n";
text += "Shape.TextFrame[" + shapeid + "].Links[" + linkid + "].ExternalHyperlink: " + link.ExternalHyperlink + "\r\n";
text += "Shape.TextFrame[" + shapeid + "].Links[" + linkid + "].InternalHyperlink: " + link.InternalHyperlink + "\r\n";
text += "Shape.TextFrame[" + shapeid + "].Links[" + linkid + "].JumpType: " + link.JumpType + "\r\n";
text += "Shape.TextFrame[" + shapeid + "].Links[" + linkid + "].ActionType: " + link.ActionType + "\r\n";
return text;
}
public string GetSlideShapes(int id)
{
string text = "";
Slide slide = presentation.Slides[id];
for (int j = 0; j < slide.Shapes.Count; j++) {
Shape shape = slide.Shapes[j];
if (!shape.IsTextHolder && shape.TextFrame != null) {
text += "Shape.TextFrame[" + j + "]: " + shape.TextFrame.Text + "\r\n";
text += "Shape.TextFrame[" + j + "]: " + shape.TextFrame.Links.Count + "\r\n";
for (int x = 0; x < shape.TextFrame.Links.Count; x++) {
Link link = shape.TextFrame.Links[x];
text += ProcessLink(link, j, x);
}
}
}
for (int j = 0; j < slide.Placeholders.Count; j++) {
Placeholder placeholder = slide.Placeholders[j];
if (placeholder is TextHolder) {
TextHolder th = (TextHolder)placeholder;
text += "Place.TextHolder[" + j + "]: " + th.Text + "\r\n";
text += "Place.TextHolder[" + j + "]: " + th.Links.Count + "\r\n";
for (int x = 0; x < th.Links.Count; x++) {
Link link = th.Links[x];
text += ProcessLink(link, j, x);
}
}
}
return text;
}