Forum Discussion
Tom_Griffith
May 16, 2023Copper Contributor
VBA - Range to include numbered lists
Hello. If you have a minute, I'm extracting text from a range within MS Word...for example...
targetRange.Start=200
targetRange.End=500
This returns all the text (targetRange.Text) but since unformatted (although line returns seem to be preserved), all numbered list labels (1,2,3...a, b, c sublists, etc) within the Range are stripped. Is there a way to preserve all the list designations within the text when setting a Range object? Tried targetRange.FormattedText but that doesn't seem to make a difference. thank you.
13 Replies
Sort By
You can retrieve the formatted text from a range. However, as Doug wrote, making a suggestion would be a lot easier if we knew exactly what you are trying to accomplish with your macro.
- Tom_GriffithCopper ContributorHi. yeah, it gets the format but the numbered lists don't seem to be captured. I'm trying to take the range wording and put it into a text field in a db. Thank you.
Tom_Griffith What do you want to do with the range?
- Tom_GriffithCopper ContributorHi. I'm trying to extract the wording from the range in MS Wprd and put it into a text field in a db. However, the numbered list labels aren't caught with Text and FormattedText. thank you so much