views:

174

answers:

1

Hi All,

Requirement is this ...

We are reading word document and getting all annotation from that document, and we are sending this document to user, when user open the document that time document should open with some specific page specific paragraph. ( That specific page, paragraph location we can give it, I can give the org.apache.poi.hwpf.usermodel.Range object. )

Please provide some example code to do this functionality ...

Appreciate you help ...

A: 

There is no way this can be achieved using Apache POI.

The only way I can think of to have Microsoft Word scroll to a specific range when a document is opened would be to include an AutoOpen VBA macro that selects the range.

For example, to make the 9th paragraph be selected you would have to include the following VBA code (it goes without saying that this only works if macros are enabled):

Public Sub AutoOpen()

    ActiveDocument.Paragraphs(9).Range.Select

End Sub
0xA3
Thanks Divo, but we are using java and Linux server ...
Bihag Raval