Results 1 to 20 of 30

Thread: Extracting Word form Data and exporting to Excel spreadsheet

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #16
    VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,273
    Location
    Change:
    Dim CCtrl As Word.ContentControl
    to:
    Dim FmFld As Word.FormField

    Change:
    strFile = Dir(strFolder & "\*.docx", vbNormal)
    to:
    strFile = Dir(strFolder & "\*.doc", vbNormal)

    Change:
    For Each CCtrl In .ContentControls
    …
    Next
    to:
        For Each FmFld In ActiveDocument.FormFields
          j = j + 1
          With FmFld
            Select Case .Type
              Case Is = wdFieldFormCheckBox
               WkSht.Cells(i, j).Value = .Checked
              Case Else
               WkSht.Cells(i, j).Value = .Result
              Case Else
            End Select
          End With
        Next
    Last edited by macropod; 09-06-2018 at 07:21 PM.
    Cheers
    Paul Edstein
    [Fmr 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
  •