Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Pasted text from Excel to Word replaces previous paragraph

Hi, I'm trying to paste text from Excel to Word. I cannot get it to work
right - everything is pasted on line 1 in Word. The previously pasted text
gets replaces by the later pasted text. Can anyone help me out here?

Here's the macro I've been trying to use:

Sub TW()

Dim AppWD As Word.Application
Dim DocWD As Word.Document
Dim RangeWD As Word.Range

Set AppWD = CreateObject("Word.Application.11")
AppWD.Visible = True

Set DocWD = AppWD.Documents.Add
With DocWD
Set RangeWD = .Range
Sheets("T").Select
Range("A15").Select
Selection.Copy
With RangeWD
..Font.Name = "Arial"
..Font.Size = 12
..Font.Bold = True
..PasteSpecial DataType:=wdPasteText, Placement:=wdInLine
..InsertParagraphAfter
..Collapse wdCollapseEnd
..InsertParagraphAfter
End With
Set RangeWD = .Range
Sheets("T").Select
Range("A17").Select
Selection.Copy
With RangeWD
..Font.Name = "Arial"
..Font.Size = 12
..Font.Bold = True
..PasteSpecial DataType:=wdPasteText, Placement:=wdInLine
..InsertParagraphAfter
'.InsertParagraphAfter
..Collapse wdCollapseEnd
..InsertParagraphAfter
End With

End With

Sheets("S").Activate

End Sub


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
word wrap & pasted text jan@longcroft Excel Discussion (Misc queries) 4 August 28th 08 03:43 PM
how to preserve paragraph breaks in pasted text? Bob Excel Discussion (Misc queries) 4 June 18th 08 07:15 PM
Problem with excel charts pasted into Word laudrup Excel Discussion (Misc queries) 2 March 9th 06 12:08 AM
Pasting Word table cell with paragraph markers into single Excel c Steve Excel Discussion (Misc queries) 1 June 16th 05 11:26 PM
Can not see all of a pasted paragraph from Word in a cell. Kat Excel Discussion (Misc queries) 2 December 23rd 04 06:37 PM


All times are GMT +1. The time now is 06:55 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"