Page 1 of 1

Setting an ID or some marker on Text in .docx?

PostPosted: Thu Mar 31, 2011 4:44 am
by smer4
My task is:

Java program exports in .docx a List of Strings.
Each String is written in separate paragraph.
Each this String with must have in the document some kind of ID-number
or some other marker, so user can not change the relationship ID to String.
ID can be displayed as a digit whitch a user can not change, or ID can be invisible.
As a user copys or moves Text, the ID must move with it.
After a work with a .docx File user will have the Strings in wrong order,
but the Java-programm must know the right order according to the IDs.

My idea was to do that on docx4j lib but i m not sure how exactly i must implement the IDs.

My very last idea is to set a SmartTags on each Character on String.
I have heard about another solution with Programmatik tags but i m not sure how to use it.

I will be very grateful of someone answer me because thats my bachelor thesis...

Re: Setting an ID or some marker on Text in .docx?

PostPosted: Thu Mar 31, 2011 8:35 am
by jason
Have a look at content controls, which can have an ID. If you are running Word, enable the Developer tab to be able to insert them.

Alternatively, bookmarks.

Re: Setting an ID or some marker on Text in .docx?

PostPosted: Tue Apr 05, 2011 8:45 am
by smer4
Yes thatks content controls ("w:sdt") semms to work
What are the bookmarks? what tag is that?