AddItem Method

LabView ActiveX Properties and Methods

AddItem Method

Installed With: Base Package

Class: ProjectItem Methods (ActiveX)

Adds a new project item of the specified type to the LabVIEW project with the referenced item as the parent.

This method returns an error if the specified type cannot be created under the current item. The method also returns an error when you try to add a shared variable to a library that is not opened in a project.

Syntax

object.AddItem(name, path, type)

Parameters

NameTypeDescription
nameStringName of the project item you want to add.
pathStringPath to the project item you want to add.
typeStringSpecifies the project item type. The following values are the most common type values:
  • VI
  • Folder
  • Library
  • XControl
  • EXE
  • DLL
  • Source Distribution
  • Installer
  • Zip File
  • Hyperlink
Some of the values listed above are supported only on certain LabVIEW Development Systems. Refer to ni.com/labview for more information about LabVIEW Development Systems.

To determine the value of type for a project item that is not listed above, use the TypeString property to programmatically return the type of the item. For cross-language reasons, this string is always in English.

Return Value

ProjectItem*