|
-
Mar 13th, 2007, 03:04 AM
#1
Thread Starter
Junior Member
Cannot convert from 'string' to 'ref object' ?
Hi to everybody
I have a method like this
public bool stduy(string filename)
{
int max = 500;
Word.ApplicationClass wordApp = new Word.ApplicationClass();
object file = filename;
object readOnly = false;
object isVisible = false;
object miss = System.Reflection.Missing.Value;
Word.Document doc = wordApp.Documents.Open(filename, ref miss,ref readOnly, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref isVisible);
Word.WdStatistic countedWords = Word.WdStatistic.wdStatisticWords;
int num = doc.ComputeStatistics(countedWords, ref miss);
if (num > max)
{
return false;
}
else
{
return true;
}
}
and when i build it, says Cannot convert from 'string' to 'ref object' , so where might i have made a mistake?
Thanks
-
Mar 13th, 2007, 03:21 AM
#2
Re: Cannot convert from 'string' to 'ref object' ?
Please use the [code][/code] tags.
You've passed filename instead of ref file in the first parameter of the call to Word.Documents.Open.
-
Mar 13th, 2007, 03:49 AM
#3
Thread Starter
Junior Member
Re: Cannot convert from 'string' to 'ref object' ?
Sorry i forgot to use tags. And thanks for the help
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|