We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose.Word Insertion Point

Hi,

I added multiple insertion points and tried to put something to these points. I used the method which I see in demo “Document Builder”.
The template file and the result document are attached. As you see in the result document, I can’t go through the insertion points and put something to that point.
What is my mistake? Here is the source:

builder.moveToMergeField(“MyInsertionPlace1”);

//Specify paragraph formatting before calling InsertParagraph or Writeln.
builder.getParagraphFormat().getBorders().get(BorderType.TOP).setLineStyle(LineStyle.DOUBLE);
builder.getParagraphFormat().getBorders().get(BorderType.TOP).setLineWidth(2);
builder.getParagraphFormat().setAlignment(ParagraphAlignment.CENTER);
builder.getParagraphFormat().getShading().setForegroundPatternColor(new Color(240, 255, 255));
builder.getParagraphFormat().getShading().setTexture(TextureIndex.TEXTURE_SOLID);
builder.getParagraphFormat().setLeftIndent(2 * 72); //2 inchdes by 72 points.
builder.getParagraphFormat().setSpaceBefore(12);
builder.getParagraphFormat().setSpaceAfter(12);
builder.getFont().setName(“Arial”);
builder.getFont().setSize(12);
builder.write("This fragment demonstrates use of paragraph formatting to specify ");
builder.writeln(“alignment, spacing, borders and shading. MAYDIN1”);
builder.getParagraphFormat().clearFormatting();

// maydin: MyInsertionPlace2 denemesi:
builder.moveToMergeField(“MyInsertionPlace2”);
builder.getFont().setBold(true);
builder.write("Veritabanı Testleri: ");
builder.getFont().setBold(false);
builder.write(“MAYDIN2”);
builder.getParagraphFormat().clearFormatting();

// maydin: MyInsertionPlace2 denemesi:
builder.moveToMergeField(“MyInsertionPlace3”);
builder.getFont().setBold(true);
builder.write("Veritabanı Testleri: ");
builder.getFont().setBold(false);
builder.write(“MAYDIN3”);
builder.getParagraphFormat().clearFormatting();

Thanks,
M.AYDIN
TUBITAK, TURKEY

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. You use merge fields as “insertion points”. After moving DocumentBuidler cursor to merge field it is removed. If you need to use an insertion points multiple times, you can try using bookmarks:

http://www.aspose.com/documentation/.net-components/aspose.words-for-.net-and-java/working-with-bookmarks.html

Best regards.