this works fine it i operate on one .doc file; however, if i process
multiple files, i get the following error: Requested Clipboard
operation did not succeed.
i suspect i need to clear my clipboard at some point, er something. in
the code below see the comment, as far as clearing the data object...
i appreciate any input....thanks to all
--
jen
-Major code snippage <-
while (FileListEnumerator.MoveNext())
{
lbFilesProcessed.Items.Add(FileListEnumerator.Key. ToString());
Word.Application app = new Word.ApplicationClass();
object nullobj = System.Reflection.Missing.Value;
object file = FileListEnumerator.Key.ToString();
Word.Document doc = app.Documents.Open(
ref file, ref nullobj, ref nullobj,
ref nullobj, ref nullobj, ref nullobj,
ref nullobj, ref nullobj, ref nullobj,
ref nullobj, ref nullobj, ref nullobj,
ref nullobj, ref nullobj, ref nullobj, ref nullobj);
doc.ActiveWindow.Selection.WholeStory();
doc.ActiveWindow.Selection.Copy();
IDataObject data = Clipboard.GetDataObject();
lbResults.Items.Add(data.GetData(DataFormats.Text) .ToString());
//maybe clear the data object here?
doc.Close(ref nullobj, ref nullobj, ref nullobj);
app.Quit(ref nullobj, ref nullobj, ref nullobj);
}
-Major code snippage <-