Visual Basic Extensibility Reference
See Also Example Applies To
Returns the newly added component.
object.AddFile (ByVal pathname As String, [relateddocument As Boolean]) As VBComponent
The AddFile method syntax has these parts:
|object||An object expression that evaluates to an object in the Applies To list.|
|pathname||Required. A string expression specifying the path and filename of the file to open as a template.|
|relateddocument||Optional (for text files only). Default = False. A Boolean expression specifying whether the file is to be treated as a standard module or a document. If set to True, then the file added is treated as a document file.|
Files that are normally Visual Basic project components, such as forms, cause an error if the relateddocument parameter is set to True. The relateddocument parameter is required only when adding text files that can be treated as either standard modules or documents.