You need to run your code in the timer_tick function rather than in the Document_Open function. I provided a code sample for you in your other question that effectively uses the timer_tick event.
Timer Timer1 = new Timer();
void Application_DocumentOpen(Microsoft.Office.Interop.Word.Document Doc)
{
InitializeTimer();
}
void InitializeTimer()
{
Timer1.Interval = 30000;
Timer1.Tick += new EventHandler(Timer1_Tick);
}
private void Timer1_Tick (Object sender, EventArgs e)
{
DocumentEditingSendToServer(Doc.Application.ActiveDocument);
}
And in your document_close event, you need to stop your timer.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…