BobTheSpreadsheetBuilder
New Member
- Joined
- Nov 23, 2023
- Messages
- 13
- Office Version
- 2016
- Platform
- Windows
Hi,
I have put together a working script that opens a selected word document, searches through it for key words, and pastes results into the spreadsheet. See below my import of a song lyrics. Apologies for poor quality photo.
The problem is there are spaces missing where sentences end so that some words are merged as one in some places.
I have tried using Replace of vbLf and vbCr but I am having problems understanding the range requirement for the text Range function
( my Dim statement for the text is :
Dim docText As String
docText = ActiveDocument.Content.Text
whereas to Insert a Replace command, I need a Range for the
Range.Replace vbCR, " " line
and I am unsure how to link them up
Does anyone have any idea how to merge the Replace command into the otherwise functioning script ?
Any advice greatly appreciated,
Picture to follow
Bob
I have put together a working script that opens a selected word document, searches through it for key words, and pastes results into the spreadsheet. See below my import of a song lyrics. Apologies for poor quality photo.
The problem is there are spaces missing where sentences end so that some words are merged as one in some places.
I have tried using Replace of vbLf and vbCr but I am having problems understanding the range requirement for the text Range function
( my Dim statement for the text is :
Dim docText As String
docText = ActiveDocument.Content.Text
whereas to Insert a Replace command, I need a Range for the
Range.Replace vbCR, " " line
and I am unsure how to link them up
Does anyone have any idea how to merge the Replace command into the otherwise functioning script ?
Any advice greatly appreciated,
Picture to follow
Bob
