title: How do I use VBA to add the File Name into the Footer?
body: <p>Here is what I have so far :)</p>
  
  <p>What I am trying to do is add the filepath and the file name into the footer in the word document, that is being created from excel...</p>
  
  <pre><code>Function ReportTypeC()
  
  Dim wdApp As Word.Application
  Dim wb As Workbook
  Dim SrcePath As String
  Dim FileName As String
  
  FileName = ActiveDocument.FullName
  
  SrcePath = "L:\TEST\Archive\unnamed.jpg"
  
  Set wdApp = New Word.Application
  
  With wdApp
      .Visible = True
      .Activate
  
      .Documents.Add
      Application.CutCopyMode = False
  
      .ActiveDocument.Sections.Item(1).Headers(wdHeaderFooterPrimary) _
          .Range.InlineShapes.AddPicture (SrcePath)
  
      .ActiveDocument.Sections(1).Footers(wdHeaderFooterPrimary) _
      .PageNumbers.Add PageNumberAlignment:=wdAlignPageNumberLeft, FirstPage:=True
  
      'With ActiveDocument.Sections(1)
          '.Footers(wdHeaderFooterPrimary).Range.Text = "FileName"
      'End With
  End With
  
  End Function
  </code></pre>