none
How do I recover multiline text from the SpellCheck interface? RRS feed

  • Question

  • Using a code snippet shown me in this Forum, I invoked Word's SpellCheck. But I can't seem to recover the text data in unmodified form.

    I have a text array which I am presenting for checking in a Multiline TextBox; I load the TextBox with {String.Join(vbCrLf,array)}, but both {TextBox1.Text = range.Text} and {TextBox1.Text = doc.Range().Text.Trim(chars)} return, not a multiline TextBox fill, but a single string with all of the vbCrLf codes embedded but unacted upon.

    I realize that this is most likely a TextBox problem, But I'm asking my question here because Word Developers are likely to have dealt with things like it.

    Price Buhrman

    Sunday, November 11, 2012 8:59 PM

Answers

  • Hi Price

    I'm not sure I understand exactly what you're after, but my best guess is that you should probably do a Replace on the vbCrLf to replace it with an empty string ("")?


    Cindy Meister, VSTO/Word MVP, my blog

    • Marked as answer by BuhrmanP Tuesday, November 13, 2012 7:55 PM
    Monday, November 12, 2012 10:43 AM
    Moderator

All replies

  • Hi Price

    I'm not sure I understand exactly what you're after, but my best guess is that you should probably do a Replace on the vbCrLf to replace it with an empty string ("")?


    Cindy Meister, VSTO/Word MVP, my blog

    • Marked as answer by BuhrmanP Tuesday, November 13, 2012 7:55 PM
    Monday, November 12, 2012 10:43 AM
    Moderator
  • It was, indeed, a string processing problem, induced by my assumption that the .Split and .Join Methods were symetrical. Thank you, Cindy, for your hint.

    Price Buhrman

    Tuesday, November 13, 2012 7:54 PM