Prod.: Engine, ver.: 6, ID: 60001489, HowTo : Using FindFile to retrieve the full filename of an opened Document

HowTo : Using FindFile to retrieve the full filename of an opened Document

Article60001489
TypeHowTo
ProductEngine
Version6
Date Added9/12/2011
Submitted byClaude UZAN
Keywords

Subject

Using FindFile to retrieve the full filename of an opened Document

Summary

Using FindFile to retrieve the full filename of an opened Document

Solution

The Filename property of the vdDocument returns the filename that is being passed to the Open procedure of the Document

vdFramedControl.BaseControl.ActiveDocument.Open ("test.vdml");
MessageBox.Show(vdFramedControl.BaseControl.ActiveDocument.FileName);

The above code will return "test.vdml" as Filename.


If you want to get the full filename of this file you can use the FindFile method of vdDocument as following

string retFilename = "";
bool ret = vdFramedControl.BaseControl.ActiveDocument.FindFile(vdFramedControl.BaseControl.ActiveDocument.FileName, out retFilename);
if (ret) MessageBox.Show (retFilename);

And this way you can get the full filename of your file.