Description

Adds file content to the Current.

Return Type

A McDBNodes object.   A McDBNodes collection of McDBNode instances added. Implementations designed not to create new McDBNode instances will return the Current instance for each added file to allow McDBNodes.Count to specify the added count.

Failure Returns Nothing.

Failure conditions:
E_INVALIDARG Invalid parameter value.
ERROR_CANCELLED When the operation has been cancelled by a automation notification or user-interface.
OLE_E_BLANK When the Current is inaccessible.
Implementation specific Error.

Syntax

object.AddFile (sFilePath, [eOverWrite], [eDataStorage], [sDisplayName])

The AddFile Method syntax has these parts:

PartDescription
objectAn expression evaluating to an object of type McDataNodes.
sFilePathRequired. A String value. The fully qualified file path specifying the content to add. The file path may a file folder. Multiple files may be added at once when delimited with vbNullChar (ASCII character 0). This function does NOT accept multiple files specified using the common open dialog format (Parent PathFile1File2). Shell link (.lnk) files will be de-referenced so that the target (object pointed to) will be added instead. Replace the extension of a shelllink file to ".lnk*" to save the actual shelllink file to the Current. Files of type .url are not dereferenced by the function.
eOverWriteOptional. A mcDataNodeOverwrites enumeration, as described in settings. Specifies the granularity of the store operation. The McDataSource implementation decides how the object is added to the Current.Node. The default implementation for the McImage actually adds a new McDBNode to the Children collection of the Current.Node. All implementations must overwrite the Current.Node (itself) when any 'remove' option is specified (mcdaton_Remove*).
eDataStorageOptional. A mcDataNodeStorageMethods enumeration, as described in settings. : The method of storing proprietary data to the the new McDBNode. This value will be mcdatnsm_NotSpecified when a AddFile handler cannot be found.
sDisplayNameOptional. A String value. : An identifier specifying a particular McDataSource implementation.

Settings

The settings for eOverWrite are:

ConstantValueDescription
 mcdaton_NoOverwriteMakeNew0

Default: FALSE - Add new with all content and make new when instead of overwrite.

 mcdaton_Attributes1

add or overwrite attributes

 mcdaton_AttributesRemoveOld2

remove any existing attributes (prior to save)

 mcdaton_Data4

add or overwrite data

 mcdaton_DataRemoveOld8

remove existing data (prior to save)

 mcdaton_Icons16

add or overwrite icons

 mcdaton_IconsRemoveOld32

remove any existing attributes (prior to save)

 mcdaton_Categories64

add categories

 mcdaton_CategoriesRemoveOld128

remove any existing categories (prior to save)

 mcdaton_Children256

add children

 mcdaton_ChildrenRemoveOld512

remove any existing children (prior to save)

 mcdaton_RemoveOld682

Overwrite All

 mcdaton_All1023

Add or Overwrite all

 mcdaton_AllTrue-1

Legacy support. Same as mcdaton_All.

The settings for eDataStorage are:

ConstantValueDescription
 mcdatnsm_NotSpecified0

No Value. Use default value specified to the database type.

 mcdatnsm_StoreFilepath65536

Store the filename of a file (file must be already saved)

 mcdatnsm_StoreFileData131072

Save the data in the database

 mcdatnsm_StoreCopyFileName262144

Save to a database managed file and store filename in database

 mcdatnsm_All458752

Not a valid value. Use for bit mask of possible values.

Remarks

The file must have a McDataSource registered for the given sDisplayName. The selection is ignored.