You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by tapaswini <ta...@zinniasystems.com> on 2009/06/11 12:35:04 UTC

not able to get the correct Range object for the area inside the textbox

Thanks Mark for your suggestion. 
I am able to get the Shape objects but problem is there is no method to set
the text in the shape object. 

Also, I am not able to get the correct Range object for the area inside the
textbox. Please let me know how can I refer to the area inside a textbox so
that I can modify the text. 

I have full control over the template and can create placeholders. But I am
not able to modify a piece of text which is inside a textbox. 

Any suggestion will be very helpful. 

Regards, 
Tapaswini 

-- 
View this message in context: http://www.nabble.com/not-able-to-get-the-correct-Range-object-for-the-area-inside-the-textbox-tp23978886p23978886.html
Sent from the POI - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: not able to get the correct Range object for the area inside the textbox

Posted by MSB <ma...@tiscali.co.uk>.
Had the chance to play around with some code and I am beginning to think that
it will not be possible to write text into a textbox using hwpf.

Firstly, my suggestion to use placeholders was completely useless. The
placeholder was not recognised at all; I had hoped that it would be much as
the text within a table's cell is. Secondly, all you are able to do with the
Shape once you have it is recover it's location within the document and it's
dimensions. Sadly, it does not seem possible to position a piece of text
using these values so that it appears within the textbox.

Sorry I could not be of more help.

Yours

Mark B


tapaswini wrote:
> 
> Thanks Mark for your suggestion. 
> I am able to get the Shape objects but problem is there is no method to
> set the text in the shape object. 
> 
> Also, I am not able to get the correct Range object for the area inside
> the textbox. Please let me know how can I refer to the area inside a
> textbox so that I can modify the text. 
> 
> I have full control over the template and can create placeholders. But I
> am not able to modify a piece of text which is inside a textbox. 
> 
> Any suggestion will be very helpful. 
> 
> Regards, 
> Tapaswini 
> 
> 

-- 
View this message in context: http://www.nabble.com/not-able-to-get-the-correct-Range-object-for-the-area-inside-the-textbox-tp23978886p23987212.html
Sent from the POI - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: not able to get the correct Range object for the area inside the textbox

Posted by MSB <ma...@tiscali.co.uk>.
Have you tried creating a textbox with a placeholder - some text that you can
search for, maybe 'TextBox1' for example inside it and then trying to
replace that string of text? Again, I have not tried this but I would expect
that if you open a document, get the top level range from that, get a list
of Paragraph(s) from the Range and then work through each Paragraph, then
you should see a Paragraph object for the 'TextBox1' String returned to you.
If so, then it ought to be a matter of replacing this text and seeing what
happens.

With regard to your other question, no, I do not know how to access the
space inside the Textbox, sorry. HWPF is still an immature product that is
being developed and it may be - that is a may be - that it cannot currently
support the functionality you require.

Having said that, as soon as I have the time, I will play with some code to
see what happens. Sadly however, I cannot promise when this will be as I am
looking into another problem for a list member currently.

Yours

Mark B


tapaswini wrote:
> 
> Thanks Mark for your suggestion. 
> I am able to get the Shape objects but problem is there is no method to
> set the text in the shape object. 
> 
> Also, I am not able to get the correct Range object for the area inside
> the textbox. Please let me know how can I refer to the area inside a
> textbox so that I can modify the text. 
> 
> I have full control over the template and can create placeholders. But I
> am not able to modify a piece of text which is inside a textbox. 
> 
> Any suggestion will be very helpful. 
> 
> Regards, 
> Tapaswini 
> 
> 

-- 
View this message in context: http://www.nabble.com/not-able-to-get-the-correct-Range-object-for-the-area-inside-the-textbox-tp23978886p23981984.html
Sent from the POI - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org