+ Reply to Thread
Results 1 to 2 of 2

Inserting and copy from a word object in Excel

  1. #1
    Alex Martinez
    Guest

    Inserting and copy from a word object in Excel


    Hi,

    I am using Excel 2002 and I insert a word object in my spreadsheet. What I
    want to do is copy some text from the same spreadhseet below either from
    Excel or from another word object and paste it into a word object at the
    very top. (See below what I want to paste into the word object). I can do
    this using a command button - macro, but How can I do this? Any tips will
    be appreciated. Thank you.


    Name
    Classification
    Area
    Zone




  2. #2
    Forum Contributor
    Join Date
    12-11-2004
    MS-Off Ver
    2007
    Posts
    137
    Hello Alex

    I'm not sure to understand but i hope this example help you



    Dim WordApp As Object
    Dim WordObj As Shape

    Application.ScreenUpdating = False

    'suppose Word Object is the first object in the sheet
    Set WordObj = Worksheets(1).Shapes(1)
    Set WordApp = WordObj.OLEFormat.Object.Object.Application

    'goto the fist line in the Word Object
    WordApp.Selection.GoTo What:=wdGoToLine, Which:=wdGoToAbsolute, Count:=1
    'insert datas
    WordApp.Selection.TypeText Text:="essai d'insertion" & vbLf & Range("A1") & vbLf

    Range("A1").Select
    Application.ScreenUpdating = True



    Regards ,
    michel

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1