Skip to content

Instantly share code, notes, and snippets.

@honda0510
Created April 5, 2012 06:28
Show Gist options
  • Save honda0510/2308441 to your computer and use it in GitHub Desktop.
Save honda0510/2308441 to your computer and use it in GitHub Desktop.
文字列をクリップボードにコピー
function CopyText(TextData) {
var form = new ActiveXObject('Forms.Form.1');
var textbox = form.Controls.Add('Forms.TextBox.1').Object;
textbox.MultiLine = true;
textbox.Text = TextData;
textbox.SelStart = 0;
textbox.SelLength = textbox.TextLength;
textbox.Copy();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment