PC Review


Reply
Thread Tools Rate Thread

Copy-pasting (unformatted) to a word document

 
 
=?Utf-8?B?cmFwaGllbDIwNjM=?=
Guest
Posts: n/a
 
      12th Sep 2007
Hi

I'm trying to copy-paste (unformatted), a series of cells in excel into
Word. I've got the below macro which does some of this but it keeps pasting
the whole table either as a picture or a normal table (if you use the
disabled line instead of the enabled paste line).

However, if I manually copy-paste special and select unformatted text I get
a load of text and no tables or borders which is what I want.

Any ideas how to achieve this with the below macro?

Sub OpenAWordFile()
Dim wordApp As Object
Dim fNameAndPath As String
ActiveSheet.Range("I5:I51").Copy
fNameAndPath = "C:\Documents and Settings\tom.jordan\My
Documents\Projects\FFEC Headed Paper.doc"
Set wordApp = CreateObject("Word.Application")
With wordApp
.Documents.Open (fNameAndPath)
.Visible = True
.Selection.PasteSpecial DataType:=wdPasteText
'.Selection.PasteAndFormat (wdPasteDefault)
.Selection.WholeStory
.Selection.Font.Name = "Arial"
.Selection.Font.Size = 11
End With
Set wordApp = Nothing
Application.CutCopyMode = False
End Sub
 
Reply With Quote
 
 
 
 
=?Utf-8?B?RGFuaWVs?=
Guest
Posts: n/a
 
      10th Oct 2007
Raphiel,
I am trying to do the same and nobody gets it,
have you made it work pasting in unformatted text?
Thank
Daniel

"raphiel2063" wrote:

> Hi
>
> I'm trying to copy-paste (unformatted), a series of cells in excel into
> Word. I've got the below macro which does some of this but it keeps pasting
> the whole table either as a picture or a normal table (if you use the
> disabled line instead of the enabled paste line).
>
> However, if I manually copy-paste special and select unformatted text I get
> a load of text and no tables or borders which is what I want.
>
> Any ideas how to achieve this with the below macro?
>
> Sub OpenAWordFile()
> Dim wordApp As Object
> Dim fNameAndPath As String
> ActiveSheet.Range("I5:I51").Copy
> fNameAndPath = "C:\Documents and Settings\tom.jordan\My
> Documents\Projects\FFEC Headed Paper.doc"
> Set wordApp = CreateObject("Word.Application")
> With wordApp
> .Documents.Open (fNameAndPath)
> .Visible = True
> .Selection.PasteSpecial DataType:=wdPasteText
> '.Selection.PasteAndFormat (wdPasteDefault)
> .Selection.WholeStory
> .Selection.Font.Name = "Arial"
> .Selection.Font.Size = 11
> End With
> Set wordApp = Nothing
> Application.CutCopyMode = False
> End Sub

 
Reply With Quote
 
=?Utf-8?B?cmFwaGllbDIwNjM=?=
Guest
Posts: n/a
 
      11th Oct 2007
Daniel

Still no joy I'm afraid. Whatever I try doesn't work and nobody really knows
what I mean.

"Daniel" wrote:

> Raphiel,
> I am trying to do the same and nobody gets it,
> have you made it work pasting in unformatted text?
> Thank
> Daniel
>
> "raphiel2063" wrote:
>
> > Hi
> >
> > I'm trying to copy-paste (unformatted), a series of cells in excel into
> > Word. I've got the below macro which does some of this but it keeps pasting
> > the whole table either as a picture or a normal table (if you use the
> > disabled line instead of the enabled paste line).
> >
> > However, if I manually copy-paste special and select unformatted text I get
> > a load of text and no tables or borders which is what I want.
> >
> > Any ideas how to achieve this with the below macro?
> >
> > Sub OpenAWordFile()
> > Dim wordApp As Object
> > Dim fNameAndPath As String
> > ActiveSheet.Range("I5:I51").Copy
> > fNameAndPath = "C:\Documents and Settings\tom.jordan\My
> > Documents\Projects\FFEC Headed Paper.doc"
> > Set wordApp = CreateObject("Word.Application")
> > With wordApp
> > .Documents.Open (fNameAndPath)
> > .Visible = True
> > .Selection.PasteSpecial DataType:=wdPasteText
> > '.Selection.PasteAndFormat (wdPasteDefault)
> > .Selection.WholeStory
> > .Selection.Font.Name = "Arial"
> > .Selection.Font.Size = 11
> > End With
> > Set wordApp = Nothing
> > Application.CutCopyMode = False
> > End Sub

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Pasting from a list unformatted Suzanne S. Barnhill Microsoft Word New Users 2 20th Sep 2010 08:31 PM
Copy excel graph and pasting into word document using asp.net ravi Microsoft ASP .NET 0 3rd Jan 2009 12:41 PM
Pasting unformatted text =?UTF-8?B?RXJpayBXaWtzdHLDtm0=?= Microsoft Excel Misc 0 19th Sep 2007 01:57 PM
Extra space when pasting link from excel to word as unformatted te =?Utf-8?B?MDAxMw==?= Microsoft Word Document Management 11 31st Jan 2005 06:17 PM
Pasting unformatted text =?Utf-8?B?Sm9lIEIu?= Microsoft Excel Programming 0 7th Nov 2003 05:31 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:14 AM.