ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Across application pastespecial (https://www.excelbanter.com/excel-programming/346611-across-application-pastespecial.html)

els

Across application pastespecial
 
I am starting in Excel 2000, going to an ftp site, copying information from
theftp site, want to paste as rft into Word to allow for a find of a
filename, selection of the link to a file, copy that to a variable and pass
the address into a cell back in excel. I can not seem to be able to get the
pastespecial to function in the open document in word.
Any suggestions would be appreciated.
Thanks = Ed

JNW

Across application pastespecial
 
I don't believe Word uses pastespecial. you may just try the paste function

"els" wrote:

I am starting in Excel 2000, going to an ftp site, copying information from
theftp site, want to paste as rft into Word to allow for a find of a
filename, selection of the link to a file, copy that to a variable and pass
the address into a cell back in excel. I can not seem to be able to get the
pastespecial to function in the open document in word.
Any suggestions would be appreciated.
Thanks = Ed


els

Across application pastespecial
 
JNW,
WOrd 2000 does support Paste Special but i jsut can not seem to get the word
methods to work from Excel. Can yio give me any ideas?
Thansk = Ed

"JNW" wrote:

I don't believe Word uses pastespecial. you may just try the paste function

"els" wrote:

I am starting in Excel 2000, going to an ftp site, copying information from
theftp site, want to paste as rft into Word to allow for a find of a
filename, selection of the link to a file, copy that to a variable and pass
the address into a cell back in excel. I can not seem to be able to get the
pastespecial to function in the open document in word.
Any suggestions would be appreciated.
Thanks = Ed


JNW

Across application pastespecial
 
Always learning with office products! Thanks for the heads up.

After some research (had to pull out the old dummies book) I've come up with
a very simple example below. I've never worked with word through excel so it
was a good learning experience for me. This example just copies a range in
excel to word as an RTF (open vba for word and see the wordvba help file for
pastespecial to see more data types).

Some things to note:
-On the line that contains ".Range.PasteSpecial DataType:=wdPasteRTF"
Whatever is after the 'DataType:=' needs to be defined as a variant.
-PasteSpecial is set up different than in excel. As below you use
selection.range.pastespecial in word as opposed to just
selection.pastespecial in excel.


Sub MakeWordDoc()
Dim WordApp As Object
Dim message As String
Dim SaveAsName As String
Dim wdPasteRTF As Variant
Dim MyPath As String

Range("A1:E9").Copy

MyPath = "C:\"
Set WordApp = CreateObject("Word.Application")
SaveAsName = MyPath & "Test"

With WordApp
.Documents.Add
With .Selection
.Range.PasteSpecial DataType:=wdPasteRTF
End With
.ActiveDocument.SaveAs FileName:=SaveAsName
End With
WordApp.Quit
Set WordApp = Nothing
MsgBox "memo was created"
End Sub

I hope that helps. If not, try posting what you have and we'll try tweaking
it.


"els" wrote:

JNW,
WOrd 2000 does support Paste Special but i jsut can not seem to get the word
methods to work from Excel. Can yio give me any ideas?
Thansk = Ed

"JNW" wrote:

I don't believe Word uses pastespecial. you may just try the paste function

"els" wrote:

I am starting in Excel 2000, going to an ftp site, copying information from
theftp site, want to paste as rft into Word to allow for a find of a
filename, selection of the link to a file, copy that to a variable and pass
the address into a cell back in excel. I can not seem to be able to get the
pastespecial to function in the open document in word.
Any suggestions would be appreciated.
Thanks = Ed



All times are GMT +1. The time now is 02:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com