13
Views
7
Comments
Solved
[MSWordUtils] Inserting a Bullet List at a Specific Location
Question
mswordutils
Web icon
Forge component by Stuart Harris

Hello everyone,

I have been working with MSWordUtils to manipulate and automate some tasks in my Word documents, and it has been quite helpful. However, I’ve encountered a challenge that I hope some of you might be able to help me with.

I want to insert a bullet list at a specific location in my document, but I'm not quite sure how to go about it. I have some text already present in the document, and I want the bullet list to replace a particular word or phrase.

Here’s a simplified version of what I’m trying to achieve:

  1. Locate a specific word or phrase in the document.
  2. Replace the word or phrase with the bullet list.

Does anyone know if this is possible with MSWordUtils? Any examples or documentation references would be greatly appreciated!

Thank you in advance for your help!

Solution

Thanks DerAstrit,

Apologies I missed the key phrase in your post that of "a specific place".

You are correct there is no action to do that currently.

With the underlying library, the only stable way I have found to place items at a specific location is to place a bookmark in the document at the location and to replace the bookmark with the content.  Would this work for you? If so, I will make a modification to the library to add a "ReplaceBookmarkWithBulletList" action.

Kind regards,

Stuart

Hello DerAstrit,

Try the documentation page for the component. Search for "bullet"

https://www.outsystems.com/forge/component-documentation/4422/mswordutils/0

Kind regards,

Stuart

Hi @Stuart Harris
I searched in the Documentation but could not find how to place it in a specific place. 
Do you know if another forge does that or if I am missing something?

Regards,

Astrit

Solution

Thanks DerAstrit,

Apologies I missed the key phrase in your post that of "a specific place".

You are correct there is no action to do that currently.

With the underlying library, the only stable way I have found to place items at a specific location is to place a bookmark in the document at the location and to replace the bookmark with the content.  Would this work for you? If so, I will make a modification to the library to add a "ReplaceBookmarkWithBulletList" action.

Kind regards,

Stuart


Hi Stuart,

Thank you for getting back to me. The idea of placing a bookmark at a specific location in the document and then replacing it with content sounds workable. I believe that the "ReplaceBookmarkWithBulletList" action would be a valuable addition to the library, and it would definitely assist me.

I look forward to seeing and trying out the updated library. Thanks again for your support!

Best regards,

Astrit

Hi DerAstrit,

I have been trying to insert a bullet point list at a specific point, but the underlying library does not have a direct way of doing it.

I am trying to mess with the underlying XML, but it is not looking promising at the moment.

I will keep trying for the moment.

Kind regards,

Stuart

Hi Stuart,

Hope you’re doing well! Just a quick heads-up - I’ve rigged up a temporary fix for now. I used the MSWORD_ReplaceText and mashed it up with the list to get something workable. Here’s a peek at what I did:

ServiceTransitionAndSetupTextList + "

    •     " + setuplist.Current.Text

It’s not exactly what we wanted, but it’s getting the job done for now. But yeah, having a dedicated feature for this in the future would definitely be awesome and make things a lot smoother.

Regards,

Astrit


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.