The AddFromFile method adds the contents of a text file to a Module object. The Module object may represent a standard module or a class module.
Syntax
object.AddFromFile filename
The AddFromFile method has the following arguments.
Argument | Description |
---|---|
object | A Module object. |
filename | The name and full path of a text (.txt) file or another file that stores text in an ANSI format. |
Remarks
The AddFromFile method places the contents of the specified text file immediately after the Declarations section and before the first procedure in the module if it contains other procedures.
The AddFromFile method enables you to import code or comments stored in a text file.
In order to add the contents of a file to a form or report module, the form or report must be open in form Design view or report Design view. In order to add the contents of a file to a standard module or class module, the module must be open.