Hi Team,
I have an aspose generated word document ,that contain bullets and images( arrow and hyphen images as bullets)
I want to replace some strings and some images with ascii value of other symbol
Kindly help hows this possible??
I am trying to use :
asposeDoc.getRange().replace("", "", false, true);
But its not helping out.Kindly assist here .Appreciate for very soon reply.
Thanks
Sonam Arora
To add here.How to replace a particular bullet or image with other ascii value symbol. As I can replace string with string using below.method :;:
asposeDoc.getRange().replace("oldvalue", "newvalue", true, true);
How to replace a bullet pattern with some symbol with its ascii value?
Thank
Sonam Arora
Hi Sonam,
Thanks for your inquiry. The Range.replace method replaces all occurrences of a specified string with another string. Range.replace does not replace the bullet. To replace the bullet images, please use the following code example. Hope this helps you.
Document doc = new Document(MyDir + "in.docx");
// Create a list based on one of the Microsoft Word list templates.
List list = doc.getLists().add(ListTemplate.NUMBER_DEFAULT);
// Completely customize one list level.
ListLevel level1 = list.getListLevels().get(0);
level1.setNumberStyle(NumberStyle.ORDINAL_TEXT);
level1.getFont().setName("Wingdings");
level1.setNumberFormat("\uf0af");
for (Paragraph para : (Iterable)doc.getChildNodes(NodeType.PARAGRAPH, true))
{
if (para.isListItem())
{
para.getListFormat().setList(list);
}
}
doc.save(MyDir + "Out.docx");
If you still face problem, please share your input and expected output document here for our reference. We will then provide you more information about your query along with code.