예제 #1
0
        public string FindTextByStyleForCurrentDocument(string style)
        {
            WordOM.Find find = _document.Application.Selection.Find;

            int r = _document.Application.Selection.Move();


            //error handling needed.
            // ReSharper disable UseIndexedProperty
            find.set_Style(_document.Styles[style]);
            // ReSharper restore UseIndexedProperty
            find.Text           = String.Empty;
            find.Forward        = false;
            find.MatchWildcards = true;
            find.Execute();
            return(_document.Application.Selection.Text);
        }