Hide Table of Contents
GetOpenedFileInfo Method (ISldWorks)

Gets the name of the last-requested file to open and the options in effect while the file is opening or when the file finished opening.

.NET Syntax

Visual Basic (Declaration) 
Sub GetOpenedFileInfo( _
   ByRef FileName As System.String, _
   ByRef Options As System.Integer _
Visual Basic (Usage) 
Dim instance As ISldWorks
Dim FileName As System.String
Dim Options As System.Integer
instance.GetOpenedFileInfo(FileName, Options)
void GetOpenedFileInfo( 
   out System.string FileName,
   out System.int Options
void GetOpenedFileInfo( 
&   [Out] System.String^ FileName,
&   [Out] System.int Options



Name of the last-requested file to open

NOTE: The last-requested file to open can be in the process of opening or can be finished opening.


Options in effect when the last-requested file to open as defined in swOpenDocOptions_e


STDMETHODIMP CRefNotFound::OnReferenceNotFoundNotify(BSTR strMissingReferenceFileName)


    HRESULT              hr = S_OK;

    CComQIPtr<IModelDoc> pModel;

    CComBSTR             sActiveDocPathName;

    CComBSTR             sOpenedDocPathName;

    long                 lOptions;


    // pModel can be NULL when a document is opened by double-clicking in Windows Explorer.

    if (pModel) {

        hr = pModel->GetPathName(&sActiveDocPathName);


    // sOpenedDocPathName is the name of the immediate parent

    // document that refers to the missing document.

    // sOpenedDocPathName may be different from sActiveDocPathName;

    // for example when an assembly is opened through File, Open

    // and the missing reference is a part in a sub-assembly.

    // sOpenedDocPathName will contain the name of the sub-assembly;

    // sActiveDocPathName will contain the name of the top-level

    // assembly.

    hr = iSwApp->GetOpenedFileInfo(&sOpenedDocPathName, &lOptions);

    return hr;



You can use this method in an add-in when responding to the swAppReferenceNotFoundNotify event. See Example.


See Also


SOLIDWORKS 2005 FCS, Revision Number 13.0

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

Subject:   Feedback on Help Topics
Page:   GetOpenedFileInfo Method (ISldWorks)
*   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:


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

Web Help Content Version: API Help (English only) 2016 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.