+ Reply to Thread
Results 1 to 5 of 5

Insert header logo in word doc from excel

Hybrid View

  1. #1
    Registered User
    Join Date
    02-09-2010
    Location
    Denmark
    MS-Off Ver
    MS Office 2007 Enterprice
    Posts
    15

    Insert header logo in word doc from excel

    Hi

    I'm looking for a way to insert a picture in the header of a word document, created by the following code:
                    Range("A1:G16").Select
                    Selection.Copy
                    
                    Dim a As Object
                    Set a = Nothing
                      Set a = CreateObject("Word.Application")
                      a.Documents.Add
                      a.Selection.Paste
                      
                    Application.CutCopyMode = False
                    a.Visible = True
    Does anyone have an idea on how to do this?

    Thanks in advance.

    //Scifo

  2. #2
    Valued Forum Contributor JeanRage's Avatar
    Join Date
    03-02-2009
    Location
    Nice, France
    MS-Off Ver
    Excel 2003
    Posts
    705

    Re: Insert header logo in word doc from excel

    Hi,

    You need to select the Header and then insert your picture ...
    ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
    Selection.InlineShapes.AddPicture ....
    HTH

  3. #3
    Registered User
    Join Date
    02-09-2010
    Location
    Denmark
    MS-Off Ver
    MS Office 2007 Enterprice
    Posts
    15

    Re: Insert header logo in word doc from excel

    I'm sorry, I'm new to VBA, but when I try this code, the image is
    placed under the first pasted selection.
                    Range("A1:G16").Select
                    Selection.Copy
                    
                    Dim a As Object
                    Set a = Nothing
                      Set a = CreateObject("Word.Application")
                      a.Documents.Add
                      a.Selection.Paste
                      
                      ' K3:L8 contains the picture
                      Range("K3:L8").Select
                      Selection.Copy
                    
                      a.ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
                      a.Selection.Paste
                      a.Visible = True
    Last edited by scifo; 02-16-2010 at 10:16 AM. Reason: Couldent delete old post

  4. #4
    Registered User
    Join Date
    02-09-2010
    Location
    Denmark
    MS-Off Ver
    MS Office 2007 Enterprice
    Posts
    15

    Re: Insert header logo in word doc from excel

    JeanRage -> Maybe I got your code wrong, are you able to look at my above posted code, and tell me where I failed?

  5. #5
    Registered User
    Join Date
    02-09-2010
    Location
    Denmark
    MS-Off Ver
    MS Office 2007 Enterprice
    Posts
    15

    Re: Insert header logo in word doc from excel

    As I have not recieved a fullfilling answer in a long time, I close this thread.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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