我正在研究一个程序,该程序在特定时间(循环)后自动保存Microsoft Office文档。
单击按钮将激活计时器,并在给定的时间延迟后应将CTRL+S
发送到Word并保存文档。
这是我的代码:
private void button1_Click(object sender, EventArgs e)
{
startTimer.Enabled = true;
stratTimer.Start();
}
private void startTimer_Tick(object sender, EventArgs e)
{
SendKeys.SendWait("^{s}");
MessageBox.Show("doc auto saved");
}
问题是SendKeys.Send("^{s}");
不起作用。
我该怎么做?