I'm using this code to loop through all words in a document and find out if any of them contains said string and copy them to another, file but word seems to to cut the words in the middle in case there is a '-' character. Example
For Each sentence In x.StoryRanges
For Each w In sentence.Words
If InStr(1, w, "asdf") = 1 Then
objDoc.worksheets(1).Cells(i, 1).Value = w
-continue code
it catches and copies the word "asdfaq-123" only as "asdfaq", Is there a way to copy until it hits '.' or ' '(space) or ')' , ']' etc..
Thank you!
