Skip to main content
Participant
May 14, 2014
Question

how to store indesing paragraph content with footnote reference?

  • May 14, 2014
  • 1 reply
  • 266 views

I want to store a paragraph content from an indesign document to a variable,

I tried :

Dim mpg = myIndesign.activewindow.activepage

Dim mtxt = mpg.textframes(1)

Dim mpar = mtxt.paragraphs.lastItem.contents

I can store only contents in Dim mpar but that paragraph has footnote references also

I cannot store the content with paragraph reference numbers,

Kindly anyone share any idea to solve this using VBA or VB.net

Thanks

Vimal

This topic has been closed for replies.

1 reply

Community Expert
May 14, 2014

@Vimal – you are working with the un-formatted "contents" property which is of type "String".
For footnotes and formatting you'll need the Texts object of that paragraph. Or the paragraph itself, which is also of type "Texts". If you want to access the footnotes collection then you could use the footnotes collection of that one paragraph. You could walk through that with a for-loop or access its members directly by index. Also filtering out a String object of a particular footnote, if you then use the contents property of that footnote.

I'm doing no VB-Scripting, just ExtendScript, so cannot give you the right syntax.
But in ExtendScript, you could access the first footnote of the last paragraph of the first text frame like that:

myPage.textFrames[0].paragraphs[-1].footnotes[0].contents;

Of course, first you have to define the variable myPage and make sure, that there are footnotes in that paragraph at all by checking the length property of the footnotes collection of that paragraph.

Note: In ExtendScript counting of an index begins with a 0. The first footnote in the footnotes collection is footnotes[0].
In VB it might be Footnotes[1] (or something)…

Uwe