Hi
I am using Visual Studio 2013 and Aspose Words 16.10.
As part of the document being generated by my code, I need to generate a custom table of contents. This basically involves setting a style for each paragraph, inserting the title text, a tab with a right alignment and dots leader, and then the page number. Pretty simple.
There’s just one problem. The style (which is configurable) can contain a hanging indent, and if the title of the contents item is short enough, Word treats the hanging indent as a tab stop, causing the page number to be displayed in the wrong place (far to the left of where it should be).
What I want to be able to do, is detect when this happens, and insert an extra tab character, pushing the page number to the correct position on the page. Naturally, my first thought was to detect the location of the cursor at that moment, and act accordingly. But I’m unable to determine the cursor position.
Can anyone provide some assistance as to how to do this? Can anyone thing of another workaround to this problem? I can’t use a table because of the requirement for leading dots, and the removal of the hanging indent is not an option either.
Thanks
Chris.