Hide Table of Contents
AddFile Method (IEdmFolder5)

Obsolete. Superseded by IEdmFolder8::AddFile2.

Syntax

Visual Basic (Declaration) 
Function AddFile( _
   ByVal lParentWnd As System.Integer, _
   ByVal bsSrcPath As System.String, _
   Optional ByVal bsNewFileName As System.String, _
   Optional ByVal lEdmAddFlags As System.Integer _
) As System.Integer
C# 
System.int AddFile( 
   System.int lParentWnd,
   System.string bsSrcPath,
   System.string bsNewFileName,
   System.int lEdmAddFlags
)
C++/CLI 
System.int AddFile( 
&   System.int lParentWnd,
&   System.String^ bsSrcPath,
&   System.String^ bsNewFileName,
&   System.int lEdmAddFlags
) 

Parameters

lParentWnd
Parent window handle
bsSrcPath
Path of file to copy; "" to create an empty file with name specified by bsNewFileName (see Remarks)
bsNewFileName
Optional new file name; "" to use the file name specified in bsSrcPath (see Remarks)
lEdmAddFlags
Combination of EdmAddFlag bits

Return Value

ID of the new file

Remarks

Use this method to:

  • copy a file from another folder that is either inside or outside of the vault.
  • create a new empty file.

Use:

To add multiple files to this folder, use IEdmFolder6::AddFiles to add them all at once, which is more efficient than adding them one at a time using this method.

Return codes:

  • S_OK: The method successfully executed.
  • E_EDM_PERMISSION_DENIED: The user lacks permission to add files to this folder.
  • E_EDM_NAME_ALREADY_EXISTS: There is already a file with the specified name in this folder.
  • E_EDM_INVALID_NAME: The suggested file name is invalid.
  • E_EDM_FILE_SHARE_ERROR: The source or destination file is opened exclusively by another program.
  • E_EDM_FILE_NOT_FOUND: The source file could not be found.
  • E_EDM_OPERATION_REFUSED_BY_PLUGIN: One of the installed EdmCmdType.EdmCmd_PreAdd hooks did not permit the operation.

 

To create a virtual document in a folder, pass an empty string as the source file. For example:

eFolder.AddFile(Me.Handle.ToInt32, '', path, 0) 
 

See Also

Availability

SOLIDWORKS Enterprise PDM Version 5.2


Provide feedback on this topic

SOLIDWORKS welcomes your feedback concerning the presentation, accuracy, and thoroughness of the documentation. Use the form below to send your comments and suggestions about this topic directly to our documentation team. The documentation team cannot answer technical support questions. Click here for information about technical support.

* Required

 
*Email:  
Subject:   Feedback on Help Topics
Page:   AddFile Method (IEdmFolder5)
*Comment:  
*   I acknowledge I have read and I hereby accept the privacy policy under which my Personal Data will be used by Dassault Systèmes

Print Topic

Select the scope of content to print:



x

We have detected you are using a browser version older than Internet Explorer 7. For optimized display, we suggest upgrading your browser to Internet Explorer 7 or newer.

 Never show this message again
x

Web Help Content Version: API Help (English only) 2015 SP05

To disable Web help from within SOLIDWORKS and use local help instead, click Help > Use SOLIDWORKS Web Help.

To report problems encountered with the Web help interface and search, contact your local support representative. To provide feedback on individual help topics, use the “Feedback on this topic” link on the individual topic page.