OpenFile

Method of IApplication

Opens an existing file with or w/o file dialog and returns reference to it

  • BSTR strPath = "" (optional)
  • VARIANT_BOOL bInteractive = VARIANT_FALSE (optional)
  • VARIANT Syntax (optional)
  • long nEncoding = 0 (optional)

Return Value

JavaScript

var ppDocument = Application.OpenFile(strPath, bInteractive, Syntax, nEncoding);

Visual Basic Script

ppDocument = Application.OpenFile strPath, bInteractive, Syntax, nEncoding

C++

CComPtr<IDocument> pDocument;
HRESULT hr = Application.OpenFile(strPath, bInteractive, Syntax, nEncoding, &pDocument);