View Single Post
  #11   Report Post  
Klaus Linke
 
Posts: n/a
Default

If I launch Word 2000 and try to open the TXT file (or if I
open a new DOC and attempt to insert the TXT file) a dialog
opens in Word that asks how I want the TXT file converted.


Does your macro contain ".ConfirmConversions:=3DTrue"?
Then change that to ".ConfirmConversions:=3DFalse".

Or didn't you uncheck "Tools Options General Always confirm =
conversions"?
If you want the macro to work anyway without showing the dialog, you can =
"uncheck" that option in your macro.

Insert

Dim boolConfirmConversions as Boolean
boolConfirmConversions=3DOptions.ConfirmConversion s
Options.ConfirmConversions =3D False

before the macro tries to open/insert the file, and

Options.ConfirmConversions =3D boolConfirmConversions

(to reset the option to its previous setting) after the macro has =
opened/inserted the file.

If some characters are changed to blanks, either your database isn't =
writing Windows text files (code page 1252), or Word uses the wrong =
encoding when opening the text file.
You can check the latter if you let the macro open the file, and then =
open the VBA editor (Alt+F11), go to the immediate window (Ctrl+G), type
? ActiveDocument.OpenEncoding
and hit Return. You should get
1252
for the Windows code page 1252.

If you get something different, you could use the code from the KB =
article, but using
..Encoding:=3DmsoEncodingWestern
to make sure the Windows code page is used.

If you got 1252, maybe we can figure out what code page your database =
exports if you list some characters from the database, and what they =
turn into in Word.

(BTW, I can't see how you can get an error message about =
HKEY_LOCAL_MACHINE, since the macro doesn't contain that string. Maybe =
it's coming from some other macro of yours?)

Regards,
Klaus



=20
I want to prevent that from happening, that is, I would like
to set a default in Word, to open all TXT files with a
particular conversion rather than choosing each time.
=20
Now, it happens that I want that not merely to avoid having
to make the selection. I have a Word macro that formats and
prints the TXT file in a certain way and when the macro
runs, the conversion dialog stops it. It would appear that
the problem could be solved either by having the default
that I described, or by inserting something in the macro
that would tell Word (in effect) Open the TXT file converted
as "Plain Text."
=20
In addition, there might be other approaches, but either of
those above would give me what I need.
=20
Sincere thanks once again,=20
--=20
Kenneth
=20
If you email... Please remove the "SPAMLESS."