Application.Find.Execute() method is giving problem in Windows Server 2003
-
Following is my code:- Word.Range SearchArea = _aDoc.Application.ActiveDocument.Range(ref _missing, ref _missing); // _aDoc.Content.Find.Replacement.ClearFormatting(); _aDoc.Application.Selection.Find.Execute(ref findText, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing); SearchArea = _aDoc.Application.Selection.Find.Replacement.Application.Selection.Range; Object oMissed = SearchArea; Object oLinkToFile = false; //default Object oSaveWithDocument = true;//default _aDoc.InlineShapes.AddPicture(fileName, ref oLinkToFile, ref oSaveWithDocument, ref oMissed); File.Delete(fileName); this.FindAndReplace1("Sign1", ""); Running successfully in Windows Xp but not working in Windows Server 2003 Here i am getting exception _aDoc.Application.Selection.Find.Execute(ref findText, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing); Please any help is appreciated.reuired urgently Thanks
-
Following is my code:- Word.Range SearchArea = _aDoc.Application.ActiveDocument.Range(ref _missing, ref _missing); // _aDoc.Content.Find.Replacement.ClearFormatting(); _aDoc.Application.Selection.Find.Execute(ref findText, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing); SearchArea = _aDoc.Application.Selection.Find.Replacement.Application.Selection.Range; Object oMissed = SearchArea; Object oLinkToFile = false; //default Object oSaveWithDocument = true;//default _aDoc.InlineShapes.AddPicture(fileName, ref oLinkToFile, ref oSaveWithDocument, ref oMissed); File.Delete(fileName); this.FindAndReplace1("Sign1", ""); Running successfully in Windows Xp but not working in Windows Server 2003 Here i am getting exception _aDoc.Application.Selection.Find.Execute(ref findText, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing); Please any help is appreciated.reuired urgently Thanks
What exception r u getting? Also format the code using <pre></pre> tag.
-
What exception r u getting? Also format the code using <pre></pre> tag.
I am stuck at this place . Its working fine in Window XP but giving above mentioned ComException error here The stub received bad data Exception from HRESULT: 0x800706F7 _aDoc.Application.Selection.Find.Execute(ref findText, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing); Its urgent.Any help is highly appreciated Thanks
-
Following is my code:- Word.Range SearchArea = _aDoc.Application.ActiveDocument.Range(ref _missing, ref _missing); // _aDoc.Content.Find.Replacement.ClearFormatting(); _aDoc.Application.Selection.Find.Execute(ref findText, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing); SearchArea = _aDoc.Application.Selection.Find.Replacement.Application.Selection.Range; Object oMissed = SearchArea; Object oLinkToFile = false; //default Object oSaveWithDocument = true;//default _aDoc.InlineShapes.AddPicture(fileName, ref oLinkToFile, ref oSaveWithDocument, ref oMissed); File.Delete(fileName); this.FindAndReplace1("Sign1", ""); Running successfully in Windows Xp but not working in Windows Server 2003 Here i am getting exception _aDoc.Application.Selection.Find.Execute(ref findText, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing); Please any help is appreciated.reuired urgently Thanks
Try this
Word.Find oFind = _aDoc.Application.Selection.Find;
oFind.Execute(ref findText, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing); -
Try this
Word.Find oFind = _aDoc.Application.Selection.Find;
oFind.Execute(ref findText, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing);Still it is giving me the same exception The stub received bad data
-
Still it is giving me the same exception The stub received bad data
Use late binding for the Find object. See this [http://support.microsoft.com/default.aspx?scid=kb;en-us;313104]