PDA

View Full Version : Solved: Copy Paste Cell Value To Word as Text Only



itipu
08-04-2008, 09:17 PM
Everything seems to be working I can create a word doc from excel etc etc... However if I do Copy of a Range("A1") and paste it I get the whole cell including formatting and I can't do PasteSpecial as xlValue is not supported by Word.. so how can I copy paste text only???

Much appreciated as always ;)))


With wrdApp.Selection
.ParagraphFormat.Alignment = wdAlignParagraphCenter
.Font.Size = 14
.Font.Bold = wdToggle
.Font.Bold = wdToggle
.TypeText Text:="Monthly Report: "

'REFERENCE TO A CELL IN EXCELL SHEET
wsOne.Range("A1").Copy
'HAS TO GO HERE AS TEXT ONLY
wrdApp.Paste

.TypeParagraph
.TypeParagraph
.TypeParagraph
.Font.Bold = wdToggle
.ParagraphFormat.Alignment = wdAlignParagraphLeft
.TypeText Text:="Project dimensions"
.TypeParagraph
.TypeText Text:="Enabling Theme"
.TypeParagraph
.TypeParagraph
.TypeParagraph
.InsertBreak Type:=wdPageBreak


'SAVE
Application.EnableEvents = False
wrdApp.Quit
Application.EnableEvents = True
Set wrdDoc = Nothing
Set wrdApp = Nothing
wrdApp.Visible = True
End With

RonMcK
08-05-2008, 06:58 AM
Itipu,

How did you solve your issue? I would like to see your solution.

Thanks,

Kenneth Hobs
08-05-2008, 07:09 AM
If you need a paste text only routine I could post it. However, you could just change it.


'from
wsOne.Range("A1").Copy
'HAS TO GO HERE AS TEXT ONLY
wrdApp.Paste

'to
.TypeText Text:=wsOne.Range("A1").Value

RonMcK
08-05-2008, 07:14 AM
Kenneth,

Thanks!