cominfopath

IOleCommandTarget.QueryStatus: SaveAs command is supported but not enabled


I have been using IOleCommandTarget.Exec() to execute the SaveAs command successfully on InfoPath forms. However, it is failing on a client machine because IOleCommandTarget.QueryStatus() only returns a value of OLECMDF_SUPPORTED. To use the command, it needs to be both OLECMDF_SUPPORTED and OLECMDF_ENABLED.

What could be causing the command to be not enabled?


Solution

  • The reason the command was not available was because File -> Form Options -> Filler Features -> “Save and Save as” was unchecked on the form.

    enter image description here