View Single Post
 
Old 04-04-2017, 12:54 PM
boCash boCash is offline Windows 8 Office 2010 64bit
Novice
 
Join Date: Apr 2017
Posts: 1
boCash is on a distinguished road
Default Issue Using FormFields.Result

Hey all,

I have a form field, let's call it "myIndex", that I would like to grab the contents of.

Can anyone explain why this code functions properly:
Code:
Sub test()
     MsgBox ActiveDocument.FormFields("myIndex").Result
End Sub
But this code throws an object required error:
Code:
Sub test()
    Dim myString As String
    Set myString = ActiveDocument.FormFields("myIndex").Result
End Sub
I'm going nuts trying to figure out why this isn't working.


Quote:
Edit: Figured it out, I needed to remove the Set before myString.

Last edited by boCash; 04-04-2017 at 01:01 PM. Reason: Solved
Reply With Quote