View Single Post
 
Old 02-03-2021, 03:34 AM
SMehta SMehta is offline Windows 10 Office 2013
Novice
 
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