For 1 above, the disadvantage may be:
The transfertext does have an optional argument for 'Code page'. Will
this be cause trouble if deploying an application to users from
different locations and different default code pages?
Well, I assume the solution would be to not use the code page parameter, and
it would thus default to the correct locale.
>
For 2 above, the disadvantage may be:
I read that the SCRRUN.DLL for the FSO is distributed with VB6 and
with Internet Explorer. Do you think that I should distribute it with
my application just in case a user does not have either of these two
programs installed?
I never seen windows without the FSO. However, some corporate environment
do turn off windows scripting, and that could perhaps make this fail, but
even with scripting turned off, you likely can still use the FSO.
This may complicate matters, since I understand such a dll must also
be registered on the user machine as well. Does anybody know if it is
also distributed with Access?
I would actually not worry. I never have come across a machine that
don't have the FSO. The failure rate is going to be *extremely* low
However, it likely better to re-write the output code I use to output
unit-code text.
I don't use transfer text because I would have to write out a temp query
each time, and this re-writing causes bloat. (we would be saving the query
over and over for each merge). further, as mentioned, if you use transfer
text, and the user types in the " into the text, then the word merge is
going to fail (so, you have to change each " to a single quote BEFORE you
merge, but that will require you to modify the users data..and we can't do
that!!
Last, but not least, there is a serous draw back to this!!!
the problem is that you can't use automation in word to select and tell word
that the merge data is uni-code. The *only* way I know is to use a odbc
connection, and write out what is called a schema.ini file for word. In
other words, you CAN NOT set the csv word merge to use uni-code (except
through the user interface). I have to look further, but it not that hard to
modify the ms-access code to output uni-code, but you can't modify the code
that does a the word merge to *USE* uni-code.
Until I find a solution as to how to tell word to use uni-code...we duck
soup...
To modify ms-access to output uni-code, you cna go:
Open strOutFile For Binary As intFile
'Print #intFile, strFields
strFields = strFields & StrConv(vbCrLf, vbUnicode)
Put #intFile, , strFields
' output all data
Do While rstOutput.EOF = False
strData = "" ' one line of data for csv file
For Each OneField In rstOutput.Fields
If strData <"" Then strData = strData & StrConv(",", vbUnicode)
strData = strData & StrConv(Chr(34), vbUnicode) &
StrConv(rstOutput(OneField.Name),
vbUnicode) & StrConv(Chr(34), vbUnicode)
Next OneField
strData = strData & StrConv(vbCrLf, vbUnicode)
Put #intFile, , strData
So, we can use "put" and *always* convert each character we put into the
string with strConv.
The resulting text file will be uni-code, and we not had to use FSO, or
transfertext.
However, this does not solve our problem of telling word to use uni-code for
the csv inport....
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl*****************@msn.com