poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 53528] Inserting consecutive character runs with different character properties not works properly
Date Sun, 15 Mar 2015 14:19:57 GMT

--- Comment #1 from Alex <stroghov@gmail.com> ---
Confirm the issue still exists in:


Have changed the example to see what each CharacterRun is:

import org.apache.poi.hwpf.HWPFDocument;
import org.apache.poi.hwpf.usermodel.*;
import java.io.*;

public class WordWriter {
    public static void main(String[] args) throws IOException {
        final HWPFDocument doc = new HWPFDocument(new

        final Range range = doc.getRange();

        final CharacterRun cr1 = range.insertAfter("[Bold]");

        final CharacterRun cr2 = cr1.insertAfter("[Normal]");

        doc.write(new FileOutputStream("output.doc"));

It shows:

It seems insertAfter returns the resulting string. The question is how to
reference the string that was just inserted.

Would be pleased if anyone tells me how to insert two text fragments with
different formatting in HWPF.

You are receiving this mail because:
You are the assignee for the bug.

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

View raw message