Hello,
I want to load a file via command line - using RichViewActions.
code:
...
actionOpen1.loadFile (rve, filename, ...)
What filter-Index should I take?
Okay, it's easy:
ext := UpperCase (ExtractFileExt (filename);)
if ext = '.RTF' then
fIndex := 1
...
but, is there an easier way?
Sorry, no. You need to check extensions.
However, you should calculate not CustomFilterIndex parameter, but FileFormat:
if ext = '.RTF' then
FileFormat := ffiRTF
...
CustomFilterIndex is used only if you implemented opening files in your own formats.