I have some code to import data from MS word fields to a table in my database, however I've run into a little snag.
The problem is that some of these fields will be empty. So I have code trying to import empty fields which spits out an error (Case 5941: The requested member of the collection does not exist)
What I need is a way to check if the field is empty before I try to use it, for example I tried
but of course any attempted use of doc.FormFields("Email").Result causes the same problem. How can I check the field, or make the program ignore that error?
The problem is that some of these fields will be empty. So I have code trying to import empty fields which spits out an error (Case 5941: The requested member of the collection does not exist)
What I need is a way to check if the field is empty before I try to use it, for example I tried
Code:
If Not doc.FormFields("Email").Result = "" Then
!Email = doc.FormFields("Email").Result
End If
but of course any attempted use of doc.FormFields("Email").Result causes the same problem. How can I check the field, or make the program ignore that error?