很简单:dim str1 as string ‘定义一个字符串变量str1Private Sub Command1_Click() '通过单击事件选中text1的全部内容text1.selstar=0text1.sellength=len(text1)str1=text1.seltextEnd Sub