View Single Post
 
Old 09-30-2020, 07:27 AM
Charles Kenyon Charles Kenyon is offline Windows 10 Office 2019
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,584
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

Interim step:
The following code gets the result from the first Fill-In field in a document and assigns it to the variable strResult.

Code:
Sub FieldResultFillIn()
    ' Charles Kenyon  30 Sept. 2020
    Dim strResult As String
    Dim oField As Field
    On Error GoTo ErrorHandler
    For Each oField In ActiveDocument.Fields
        If oField.Type = wdFieldFillIn Then
            Let strResult = oField.Result
            Exit For
        End If
    Next oField
    If strResult = "" Then
        MsgBox "No Fill-In Fields in this document."
    Else
        MsgBox "The text in the first Fill-In field in the document is:" & vbCrLf & strResult
    End If
    GoTo Cleanup
ErrorHandler:
    MsgBox "There do not appear to be any fields in this document."
Cleanup:
    Set oField = Nothing
    On Error GoTo -1
End Sub
To put this together, though, I need the questions asked previously answered.
Reply With Quote