Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-02-2021, 10:11 PM
SMehta SMehta is offline Notepad to Word : Pasting Specific text ie between any two blank line from notepad to word Windows 10 Notepad to Word : Pasting Specific text ie between any two blank line from notepad to word Office 2013
Novice
Notepad to Word : Pasting Specific text ie between any two blank line from notepad to word
 
Join Date: Jan 2021
Posts: 29
SMehta is on a distinguished road
Default

Andrew Sir,
The below code was just Fantastic.
Code:
Sub GetUsedParas()
  Dim sList As String, i As Long, sText As String
  For i = 1 To ActiveDocument.Paragraphs.Count
    sText = Trim(ActiveDocument.Paragraphs(i).Range.Text)
    'Debug.Print Len(sText)
    If Split(sText, vbCr)(0) = "" Then
      sList = sList & "," & i
    End If
  Next i
  MsgBox Mid(sList, 2), vbInformation + vbOKOnly, "Empty Paragraphs List"
End Sub
Thank you so much for the same.

Now coming back to Paul's Sir remark on his post #12
Quote:
For your Sample2.txt file, what are the rules for which blocks from get copied and what are the rules for where those blocks get inserted into your Sample.txt file?
Will it be possible for the Paragraph with Data from Sample2.txt to get inserted in any one Empty paragraph position. if yes how. Suppose i select paragrpah 3 with data of Sample2.txt below and insert at one of the Empty Para position lets Say 6 of Sample.txt. It should display as below
Quote:
3
"VP521X"
"SUR II* 4/0 36"" BLUE V-20 D/A"
36
8318.98
Jim takes the map to Squire Trelawney and Doctor Livesey who realise that it shows where Captain Flint, an evil and heartless pirate, has buried his stolen treasure. The Squire and the Doctor decide to go and find the treasure and invite Jim to come along. The Squire then buys a ship called the 'Hispaniola' and hires a crew led by the respected Captain Smollet. The ship's cook is a one legged man called Long John Silver whom everyone admires.
SMehta


Thread 1: No: 46342 : Post No24 : TM 14
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help to get data from notepad to word ganesang Word VBA 2 08-11-2019 10:21 PM
Word does not stop at the set tab, but it keeps forever on the same line like it would in Notepad. danvina@gmail.com Word 2 01-16-2019 02:33 PM
Notepad to Word : Pasting Specific text ie between any two blank line from notepad to word Microsoft notepad over word for saving important text files Noclip1 Word 1 10-25-2017 10:55 PM
Notepad to Word : Pasting Specific text ie between any two blank line from notepad to word Copy text with tab at start of line and paste to Notepad JohnTurnbull Word 5 08-27-2017 11:17 PM
Notepad to Word : Pasting Specific text ie between any two blank line from notepad to word Sr. Citizen Question, Please: WORD Shows Blank, But Notepad Shows "Gibberish" ? Robert11 Word 3 08-12-2013 12:35 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:05 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft