Re: How to extract strings from the code inside a field?

From: Edward Mendelson (edward_mendelson_at_ziffdavisdotcom.no.junk.no)
Date: 08/23/04


Date: Mon, 23 Aug 2004 12:45:29 -0400


"Helmut Weber" <anonymous@discussions.microsoft.com> wrote in message
news:b95c01c48919$b0d12220$a601280a@phx.gbl...
> Hi Edward,
> I played for ours with your and my code
> and could not get to work it properly.
> Ranges and duplicates of duplicates of ranges
> left me totally confused. So I thought I'd start
> from scratch and arrived at Jay's solution. Just
> one odd thing, and that's why I post this here:
> If I open a WP file, that was converted to Word 2.0,
> that comes from an englisch system, the fields
> look like:
> {symbol 65 \f "WP TypographicSymbols" \s 12}
> However, after saving and reloading, the fields
> have changed to, because of my german version:
> {sonderzeichen 65 \f "WP TypographicSymbols" \s 12}

Hi Helmut,

Many thanks for working more on this. Thanks to the help of everyone here,
who provided the intelligent parts of the code, I now have what I think is a
working macro for solving the problem of WP-created files that open in Word
with A and @ instead of quotation marks. I had to spend somet time debugging
the look-in-all-ranges code, but I think it works and I think it's
efficient.

It's cluttered with comments, and I haven't combined the
save-as-Word20-and-reopen macro with the replace-symbol-fields macro, but
it's good enough for testing.

Now the question is how to handle non-English versions. It's easy enough to
call a procedure like this at the beginning, and pop up an error message for
any language not listed -

Private Sub SymbolString (sStr As String)
Dim iLng As Integer ' application language
iLng = Application.Language
      Select Case iLng
         Case 1031: sStr = "sonderzeichen" ' German
         Case 1033: sStr = "symbol" ' English
         Case Else: sStr = "NoMatch" ' string to compare in calling sub
     End Select
     'msgBox (sStr)
End Sub

But what to do in cases like yours where the document may have been created
in another language system? I don't see anything in the help that lets me
identify the language in which a document was saved, but I assume it is
there somewhere. Perhaps it would be possible to test for the language in
which the document was saved, and set the "symbol" or "sonderzeichen" string
accordingly?

Best wishes from New York,

Edward Mendelson



Relevant Pages

  • OT (was: Re: Letter to US Sen. Byron Dorgan re unpaid overtime)
    ... You know what Edward? ... I love Spain and I detest ... no matter what the implementation language happens to be. ... itself as a silly bull in a Spanish arena. ...
    (comp.programming)
  • Re: Complexity of Languages
    ... Helmut Weber wrote: ... > Hi Lee, ... > How can a language be complex if 1000 Million people ... Prev by Date: ...
    (sci.lang)
  • Re: c++ parser
    ... language" by Edward D. Willink ... Regards, ...
    (comp.lang.cpp)
  • Re: About the language
    ... If I want to change the language to chinese... ... Edward. ... Tommy Reynolds wrote: ... > support after the system install, but they are difficult to get ...
    (Fedora)
  • Re: About the language
    ... If I want to change the language to chinese... ... Edward. ... Tommy Reynolds wrote: ... > support after the system install, but they are difficult to get ...
    (Fedora)