none
Run-time error '-2147467259(80004005'), Method 'ShowHiddenText'of object 'view'failed RRS feed

  • Question

  •  Hi,

    I am getting the below Runtime Error at one of my machine.

    Run-time error '-2147467259(80004005')
    Method 'ShowHiddenText'of object 'view'failed.

    Below is the part of code which i am using, this part of code works fine in most of the machines and i am facing the Error in some machines.

    Please let me know why i am facing this issue and a solution for it.

    I was not able to debug my code since it is working fine at my development machine, below are the 2 places where i have used ShowHiddenText

    try
    {
       try
       {
           _wordApp.ActiveWindow.View.ShowHiddenText = true;
       }
       catch { }
                   
       Word.Range foundBegRng = FindInWord(_wordDoc.Content, Settings.DocumentIdentifierBeginTag, 0);
       if (foundBegRng == null)
           return;
       Word.Range foundEndRng = FindInWord(_wordDoc.Content, Settings.DocumentIdentifierEndTag, foundBegRng.End);
       if (foundEndRng == null)
           return;
        object start = (object)foundBegRng.Start;
        object end = (object)foundEndRng.End;
        wmRange = _wordDoc.Range(ref start, ref end);
        _DocID = wmRange.Text;
     
       try
       {
          _wordApp.ActiveWindow.View.ShowHiddenText = false;
       }
       catch { }
    }

     

    public bool IsHiddenTextVisible()
    {
        try
        {
            return (_wordDoc.Content.TextRetrievalMode.IncludeHiddenText ||
                            _wordApp.ActiveWindow.View.ShowHiddenText);
        }
        catch
        {
            return false;
        }
    }

    Where _wordApp is,--> private Word.Application _wordApp; and Word is,--> using Word = Microsoft.Office.Interop.Word;

    Please let me know how we can resolve this issue.Thanks in advacne.

    Regards,Chetan.


    Chetan Rajakumar

    Monday, March 25, 2013 7:30 AM

Answers

  • Hi Chetan,

    Thank you for posting in the MSDN Forum.

    Could you please list the detailed information on the environment of the machine that throws the error?

    Beside, please make sure that you have document open when the code run to

    _wordApp.ActiveWindow.View.ShowHiddenText = True;

    if no document is opened currently, this property will not be available.

    Hope it helps.

    Best regards,


    Quist Zhang [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, March 26, 2013 1:48 PM
    Moderator