Select Range by string

Posted by Petott on Stack Overflow See other posts from Stack Overflow or by Petott
Published on 2010-06-07T11:57:05Z Indexed on 2010/06/07 12:02 UTC
Read the original article Hit count: 300

Filed under:
|

How I can change this feature so I select the range of characters in a word document between the characters "E" and "F", if I have; xasdasdEcdscasdcFvfvsdfv is underlined to me the range -> cdscasdc

private void Rango()
{
Word.Range rng;

Word.Document document = this.Application.ActiveDocument;

object startLocation = "E";
object endLocation = "F";

// Supply a Start and End value for the Range. 
rng = document.Range(ref startLocation, ref endLocation);

// Select the Range.
rng.Select();

}

This function will not let me pass by reference two objects of string type.......

Thanks

© Stack Overflow or respective owner

Related posts about c#

Related posts about office-interop