XDocuments
is a collection of XDocument
objects. It doesn't have a Save
method, and the parameter of the Close
method is the index of the object to be closed, not a boolean value. If you want to save and close a particular object, you'll probably have to do it like this:
Set xdoc = InfoPathObject.XDocuments.Open(fileName)
xdoc.Save
xdoc.CloseDocument
Untested, though, because I don't have a recent enough MS Office at hand.