You might check the BASIC macro guide particularly the section about loadComponentFromURL Method Options.Yes, there is a problem with the file TypeDetection.xml that should be used to figure out the allowed filter names: It doesn't exist in my OOo 3.1 installation, neither in my 2.4 ?!But this is one of the rare cases where the macro recorder is useful: Save a .odt file as plain text (.txt) and check out the recorded dispatcher code for .Name = "FilterName".The following code works for me:

OpenOffice 3.1.1 (2.4.3 until October 2009) and LibreOffice 3.3.2 on Windows 2000, AOO 3.4.1 on Windows 7There are several macro languages in OOo, but none of them is called Visual Basic or VB(A)! Please call it OOo Basic, Star Basic or simply Basic.

Did you actually read the wiki with the BASIC tutorial?You may have noticed that my macro doesn't use the createUnoService method, instead it uses the predefined variable StarDesktop. I copied it from the tutorial and changed it to make it more Writer centric while the original macro uses a Calc filter.

Though it would be a bit strange it seems like the createUnoService() creates a second instance of the OpenOffice Desktop core object. This second instance might be hidden "behind" the always existing permanent instance of the desktop object.Please try with StarDesktop and see if this makes a difference.

OpenOffice 3.1.1 (2.4.3 until October 2009) and LibreOffice 3.3.2 on Windows 2000, AOO 3.4.1 on Windows 7There are several macro languages in OOo, but none of them is called Visual Basic or VB(A)! Please call it OOo Basic, Star Basic or simply Basic.

That's strange. I tried several starting points to run this macro and in all cases I saw the Writer window with the plain text document activated as foreground window. My different starting points are:

Started from the Macro Editor IDE (as the only OOo window that's open)

Started from Writer with an empty "Untitled 1" document (ldif Document is opened in another window, usually when opening an existing document manually through menu commands the "Untitled 1" will vanish)

Started from Writer with an existing .odt document (same as above with the "Untitled 1")

Started the macro from the Welcome Frame (the one that is new with 3.x): Again the plain text document is opened in the foreground, but the welcome window stays open (The welcome window should normally vanish)

What operating system are you using? I use Windows 2000. Maybe someone with a different OS can help us?!

Edit: Just another thought: Can you see the Message Box with the File exists information? Is the behaviour different if you remove this MsgBox line from your macro code?

OpenOffice 3.1.1 (2.4.3 until October 2009) and LibreOffice 3.3.2 on Windows 2000, AOO 3.4.1 on Windows 7There are several macro languages in OOo, but none of them is called Visual Basic or VB(A)! Please call it OOo Basic, Star Basic or simply Basic.

I know this kind of filter dialog only when reading the file into Calc, but Writer usually "eats" anything without confirmation. Maybe you can upload a screenshot of this dialog.

As you were talking about character sets I gave it a go with a UTF-8 encoded file with some german umlauts:

the original file in Notepad: Einführungskurs

after "imported" into Writer: EinfÃ¼hrungskurs if the original file doesn't have the initial byte order mark ef bb bf

with the BOM ef bb bf after import in Writer: Einführungskurs

This is typically what you get when you have a file with some double byte utf-8 characters but the editing application (OOo Writer in our case) reads it as a 7 bit ascii or an iso-8859-1 file, because the file is lacking the BOM byte sequence.

In both cases (with BOM or without) the file is directly loaded and displayed in Writer (as Preformated Text with a fixed width font) without bothering me with a conversion dialog. Something with your file must be really strange. I can't recall that the extension .ofx is something special, so OOo would not treat it in an extraordinary way.

OpenOffice 3.1.1 (2.4.3 until October 2009) and LibreOffice 3.3.2 on Windows 2000, AOO 3.4.1 on Windows 7There are several macro languages in OOo, but none of them is called Visual Basic or VB(A)! Please call it OOo Basic, Star Basic or simply Basic.

Did you realise that the macro used Filter for the parameter name and notFiltername?In the Basic documentation wiki as referenced above I find only Filtername, FilterData and FilterOptions, but barely Filter seems to be undocumented or was added in later versions of OOo that are not yet covered by that macro documentation.

When I used your code I could reproduce the behaviour that you described (but for me there is still no character set dialog popping up!):

The .ics file is the one from my last post (UTF-8, but without BOM) and Xray (an object inspector tool -- very useful, just google for it and you will find where to download it) tells me that the object variable oDoc is NULL.That means it is not the document that is hidden, but loading the document with loadComponentFromURLfailed!

Can't really say it from the .ofx content that you cut and pasted here, but what you tell about notepad not showing the linebreaks looks like the content has Unix linebreaks (LF only) and maybe at the last line a CR/LF. A single LF is used during the export to encoded text for soft line breaks (start a new line in WYSIWYG, but not a new paragraph) while a full DOS CR/LF completes a paragraph and starts a new one in Writer WYSIWYG.

So I think if you are asked for ascii filter options it is not for the characterset, but for the linebreak because OOo finds two types of linebreaks in the file content.Hm, if I try to import a file with CR/LF and LF at the same time it directly shows the open document, no options dialog!

Maybe someone else knows more than me about this undocumented "Filter" parameter?!

OpenOffice 3.1.1 (2.4.3 until October 2009) and LibreOffice 3.3.2 on Windows 2000, AOO 3.4.1 on Windows 7There are several macro languages in OOo, but none of them is called Visual Basic or VB(A)! Please call it OOo Basic, Star Basic or simply Basic.

Did you realise that the macro used Filter for the parameter name and not Filtername?In the Basic documentation wiki as referenced above I find only Filtername, FilterData and FilterOptions, but barely Filter seems to be undocumented or was added in later versions of OOo that are not yet covered by that macro documentation.

No, I did'nt : I just recorded the macro, and this is how it came out !It's my first attempt to make an OO macro, and truly speaking, I am not yet used to the semantic of OOBasic. On top of that, finding the documentation is a headache...

Back to the problem, importing the OFX document in a blank frame seems to work. So I will develop this way.