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
@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:
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.
In VB it might be Footnotes (or something)…