using System; using System.IO; using System.Text; using System.Windows.Forms; public static class ClipboardFusionHelper { public static string ProcessText(string text) { //create a new MemoryStream instance using(MemoryStream stream = new MemoryStream()) { //get the byte data of the string byte[] data = Encoding.ASCII.GetBytes(text); //write the bytes to the MemoryStream stream.Write(data, 0, data.Length); //create a new data object and set it's data with the MemoryStream IDataObject dataObject = new DataObject(); dataObject.SetData("CXCellData", false, stream); //put the data object on the clipboard Clipboard.SetDataObject(dataObject, true); } //returning null will tell ClipboardFusion to not do //anything with the Clipboard after this macro is run return null; } }