ReplaceTextWithObject does not work with List
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start at document.ReplaceTextWithObject and ObjectReplaceTextOptions, then compare the supported object types named in the runtime exception with the List and bulletList construction shown in the report. Determine the intended behavior for replacing placeholder text with a bullet list; done means the replacement works without the unknown-object exception and preserves the list items.
Written by the indexing model from the issue text.
Description
Using Version 5.0.25228.6154
I want to replace a Placeholder Text with a BulletList.
`private static void ReplaceTextWithBulletList(DocX document, string searchValue, List replaceValue)
{
var addListOptions = new ListOptions()
{
ListType = ListItemType.Bulleted
};
var bulletList = document.AddList(addListOptions);
foreach (var item in replaceValue)
{
bulletList.AddListItem(item);
}
var replaceTextOptions = new ObjectReplaceTextOptions()
{
SearchValue = searchValue,
NewObject = bulletList
};
document.ReplaceTextWithObject(replaceTextOptions);
}`
At runtime, I get the error:
System.ArgumentException: 'Unknown object received. Valid objects are Picture, Hyperlink or Table.'
How can I replace Text with a Bullet List?
- Dominant language
- C#
- Stars
- 1.9k
- Forks
- 483
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from xceedsoftware/DocX
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
xceedsoftware/DocX#489 · 1 comment ·
-
keep formatOpen
Difficulty 3/5 1-2 days Newbie friendliness 25/100
xceedsoftware/DocX#487 · 3 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
xceedsoftware/DocX#485 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
xceedsoftware/DocX#482 · 4 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
xceedsoftware/DocX#481 · 1 comment ·
All issues in xceedsoftware/DocX
Similar issues
-
[Doc Gap] Document new --enable-public-network-access breaking change for azurebackup vault createOpencopilot documentation
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
area-dashboard
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
0 - Backlog Bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
BrighterCommand/Brighter#4539 ·
Maintainers usually reply within 1 day
-
area-networking
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
dotnet/aspnetcore#69671 · 1 comment ·
Maintainers usually reply within 1 day
-
Ignored test: FileLocalDataSourceTests.retries_loading_filePossibly taken A pull request linked to this issue is open or already merged. Opentest
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
NethermindEth/nethermind#14274 ·
Maintainers usually reply within 1 day