unidoc / unioffice

Pure go library for creating and processing Office Word (.docx), Excel (.xlsx) and Powerpoint (.pptx) documents

Home Page:https://unidoc.io/unioffice/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to replace a word in a paragraphs

moipa-cn opened this issue · comments

commented

eg: I am a handsome man
i want replace man to women.
i try

switch r.Text() {
case "man":
  r.ClearContent()
  r.AddText("I am a handsome women")
  r.AddBreak()

This is not what I want

I just need replace "women" in this paragraphs

Welcome! Thanks for posting your first issue. The way things work here is that while customer issues are prioritized,
other issues go into our backlog where they are assessed and fitted into the roadmap when suitable.
If you need to get this done, consider buying a license which also enables you to use it in your commercial products.
More information can be found on https://unidoc.io/

Hi @moipa-cn,
You can do text replacement using the node feature.
Here's the example: https://github.com/unidoc/unioffice-examples/blob/master/document/node-find-and-replace/main.go