B
bob
What im doing is parsing through Word and copying certain
words/phrases. I need to be able to use some of the
things ive copied as strings. The way ive written the
code gives me an error and im not sure why.
string test;
System.Windows.Forms.IDataObject dataobj;
dataobj = System.Windows.Forms.Clipboard.GetDataObject();
test = dataobj.GetData
(System.Windows.Forms.DataFormats.Text).ToString();
Console.WriteLine("{0}", test);
dataobj.GetaData(System.Windows.... etc.. is all one line.
I tried to save what ive copied into the clipboard as
dataobj. and then used ToString() to convert it to a
string. But it doesnt work. The code compiles but i get
an error during the actual process. And I know what I
want to be copied is in the clipboard because Ive opened
up Word and then the clipboard and have seen what i
copied over so thats not the problem. Any ideas about
what ive done wrong? Or any suggestions about how id
save what i have in my clipboard as a string?
thanks
words/phrases. I need to be able to use some of the
things ive copied as strings. The way ive written the
code gives me an error and im not sure why.
string test;
System.Windows.Forms.IDataObject dataobj;
dataobj = System.Windows.Forms.Clipboard.GetDataObject();
test = dataobj.GetData
(System.Windows.Forms.DataFormats.Text).ToString();
Console.WriteLine("{0}", test);
dataobj.GetaData(System.Windows.... etc.. is all one line.
I tried to save what ive copied into the clipboard as
dataobj. and then used ToString() to convert it to a
string. But it doesnt work. The code compiles but i get
an error during the actual process. And I know what I
want to be copied is in the clipboard because Ive opened
up Word and then the clipboard and have seen what i
copied over so thats not the problem. Any ideas about
what ive done wrong? Or any suggestions about how id
save what i have in my clipboard as a string?
thanks