Sub Temp() Dim datobj As New System.Windows.Forms.DataObject Dim strbuf As String datobj.SetData(System.Windows.Forms.DataFormats.Text, "hello") System.Windows.Forms.Clipboard.SetDataObject(datobj) If System.Windows.Forms.Clipboard.GetDataObject.GetDataPresent(System.Windows.Forms.DataFormats.Text) Then strbuf = System.Windows.Forms.Clipboard.GetDataObject.GetData(System.Windows.Forms.DataFormats.Text) End If End Sub
msdn に載っていた上のコードを、 Visual Studio .net 2003 のマクロで走らせようとすると、