Occurs prior to saving any project component with unsaved changes.
Syntax
Sub RequestWriteFile(vbproject As VBProject, filename As String, cancel As Boolean)
The RequestWriteFile event syntax has these parts:
| Part | Description |
| vbproject | A VBProject object specifying the name of the project containing the component. |
| filename | A string expression containing the name of the file to be saved. |
| cancel | A Boolean expression used as a flag to cancel the action, as described in Settings. |
Settings
The settings for cancel are:
| Setting | Description |
| True | Does not write the file to disk. This event is not triggered for any subsequent add-ins connected to the FileControl object. |
| False | Continues triggering this event for subsequent add-ins connected to the FileControl object. |
Remarks
The RequestWriteFile event occurs once for each saved component, and once for each associated binary data file (such as .Frx or .Pgx files).
This event allows add-ins to prepare the specified file for writing. For example, you could use it to enable an add-in to check out a file from a source code control project prior to writing to it.
This event occurs in all add-ins that are connected to the FileControl object. The add-in cannot prevent the file from being written to disk because the operation is complete. However, you can use this event to perform other tasks, such as: