Results 1 to 2 of 2
  1. #1
    New Lounger
    Join Date
    Oct 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    replacing pictures in the footer of a doc file

    Hi,

    I am trying to make a code, which replaces a jpg file in the footer of a word document.
    This is how I started it, but it doesn't work.
    Could anybody work?

    many thanks
    Code:
    Sub Demo()
    Dim DocSrc As Document, DocTgt As Document, HdFt As HeaderFooter
    Dim sSec As Section
    
    Set DocSrc = Documents.Open(FileName:="H:\footers\docFrom.docx", Visible:=True, AddTorecentFiles:=False)
    Set DocTgt = Documents.Open(FileName:="H:\footers\sample.docx", Visible:=True, AddTorecentFiles:=False)
    
    DocSrc.Sections(1).Footers(wdHeaderFooterPrimary).Range.Select
    
    Set DocSrc = Nothing: Set DocTgt = Nothing
    End Sub

  2. #2
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    3,913
    Thanks
    0
    Thanked 192 Times in 176 Posts
    Cross-posted (and solved) at: http://www.msofficeforums.com/word-v...directory.html
    For cross-posting etiquette, please read: http://www.excelguru.ca/content.php?184
    Cheers,

    Paul Edstein
    [MS MVP - Word]

Posting Permissions

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