Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #28  
Old 02-03-2021, 03:34 AM
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

Sir,

This time no error.
Representation of the result is quoted after the code
Wanted the result as quoted in Post #24

FYI i am also not aware of other syntaxes of VBA Word. Your guidance will be appreciated.

Code:
Sub InsertParafrom()

Dim DocSrc As Document
Dim DocTgt As Document

Set DocSrc = ActiveDocument

'Set DocTgt = Documents.Open(FileName:="C:\Text-To-MsWord\Sample2.txt", AddToRecentFiles:=False, Visible:=False)

Dim aRng As Range

Set aRng = DocSrc.Paragraphs(4).Range
aRng.InsertFile FileName:="C:\Text-To-MsWord\Sample2.txt", ConfirmConversions:=False, Link:=False, Attachment:=False
End Sub
Quote:
Robert Louis Stevenson wrote Treasure Island in 1881. It is set in the days of sailing ships and pirates and tells of the adventures of Jim Hawkins and his search for the buried treasure of an evil pirate, Captain Flint.

The story begins at 'The Admiral Benbow', the inn that belongs to Jim Hawkin's parents. A mysterious stranger called Billy Bones, who rents a room at the inn, warns Jim to keep a look out for a 'one legged man'. One day, Billy is visited by a beggar called 'Blind Pew' who gives him the 'black spot' which is the mark of imminent death among pirate crews. After Blind Pew leaves, Billy collapses and dies.
1
"VP72X"
"SUR II* 7/0 24""BL CV-1OPVN D/A"
Robert Louis Stevenson wrote Treasure Island in 1881. It is set in the days of sailing ships and pirates and tells of the adventures of Jim Hawkins and his search for the buried treasure of an evil pirate, Captain Flint.

The story begins at 'The Admiral Benbow', the inn that belongs to Jim Hawkin's parents. A mysterious stranger called Billy Bones, who rents a room at the inn, warns Jim to keep a look out for a 'one legged man'. One day, Billy is visited by a beggar called 'Blind Pew' who gives him the 'black spot' which is the mark of imminent death among pirate crews. After Blind Pew leaves, Billy collapses and dies.

Jim finds a map in Billy's sea chest just before Blind Pew returns with a band of evil pirates. Jim and his mother quickly hide before the pirates ransack the Inn looking for the map. Suddenly soldiers arrive and the pirates escape, except for Blind Pew who is accidentally trampled to death by the soldiers' horses.

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.

The ship sets sail and Captain Smollet immediately begins to doubt the trustworthiness of his crew. However, the night before they reach Treasure Island Jim overhears Silver and other members of the crew plotting to kill them all. He realises that Long John Silver and most of the crew are actually pirates and were once members of Captain Flint's crew.

Jim warns the Doctor, the Squire and the Captain about the crew's evil plans. The Captain sends most of the pirates ashore and Jim decides, at the last moment, to go ashore with them. Once there, he hides in the woods.

Whilst Jim is hiding he comes across Ben Gunn, an ex-pirate who had been marooned on the island three years ago, by his crewmates. Ben has given up piracy and promises to help Jim and his friends. Meanwhile the Captain and the others abandon the Hispaniola and take refuge in an old stockade on the Island.
11359.82

2
"VP75X"
"SURGI*II 5/0 24 BLUE CV-11 D/A"
36
12288.43

3
"VP521X"
"SUR II* 4/0 36"" BLUE V-20 D/A"
36
8318.98

4
"VP522X"
"SURGIPRO* II 3/0 36 BL V-20D/A"
36
8041.45

5
"VP556X"
"SUR II* 5/0 36"" BLUE CV-23 D/A"
36
10341.98

6
"VP556X"
"SUR II* 5/0 36"" BLUE CV-23 D/A"
36
10341.98

7
"VP630X"
"SURGPII 7/0 24""BL CV-351D/AX36"
36
17752.7

8
"VP735X"
"SUR* II 7/0 BL 24""MV-175-8 D/A"
36
26534.26

9
"VP902X"
"SUR* II 8/0 24""BL MV-135-5 D/A"
36
26562.97

10
"CL913"
"POLYSORB 2/0 36 VIOLET GS-24"
36
7938.54

11
"CL914"
"POLYSORB 0 36 VIOLET GS-24"
36
6955.57

12
"CL915"
"POLYSORB 1 36 VIOLET GS-24"
36
7468.08

13
"CL953"
"POLYSORB 2/0 36 U/D GS-21 209P"
36
8039.77

14
"GL182"
"POLYSORB 3/0 30 VIOT CV-25"
36
5896.19

15
"GL223"
"POLYSORB 2/0 30 VIOT V-30 225R"
36
6955.57
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.

The ship sets sail and Captain Smollet immediately begins to doubt the trustworthiness of his crew. However, the night before they reach Treasure Island Jim overhears Silver and other members of the crew plotting to kill them all. He realises that Long John Silver and most of the crew are actually pirates and were once members of Captain Flint's crew.

Jim warns the Doctor, the Squire and the Captain about the crew's evil plans. The Captain sends most of the pirates ashore and Jim decides, at the last moment, to go ashore with them. Once there, he hides in the woods.

Whilst Jim is hiding he comes across Ben Gunn, an ex-pirate who had been marooned on the island three years ago, by his crewmates. Ben has given up piracy and promises to help Jim and his friends. Meanwhile the Captain and the others abandon the Hispaniola and take refuge in an old stockade on the Island.
SMehta
Thread 1: No: 46342 : Post No28 : TM 16
Reply With Quote
 



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 10:59 PM.


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