Dim fileName As String = Tables("计划表窗口_Table7").Current("文件路径").Current("文本文件")
If filename.EndsWith(".Table") Then
Dim Proc As New Process '定义一个新的Process
Proc.File = filename '指定要打开的文件
Proc.Start()
Dim fdr As DataRow = DataTables("日计划").Find("日期 = '" & Date.Today & "'")
If fdr IsNot Nothing Then
fdr("学习科目") &= Tables("计划表窗口_Table7").Current("学习名称") & ";"
End If
Tables("计划表窗口_Table7").Current("最近日期")=Date.now '记录学习时间
Else
Dim app As New MSWord.Application
try
Dim doc = app.Documents.Open(fileName)
app.ActiveWindow.Selection.WholeStory
app.ActiveWindow.Selection.MoveRight(Unit:=1, Count:=1)
app.ActiveWindow.Selection.TypeParagraph
'app.ActiveWindow.Selection.TypeText(Text:=Date.Today & " 第" & datepart( "ww",Date.today) & "周") '只是显示日期
app.ActiveWindow.Selection.TypeText(Text:=Date.now & " 第" & datepart( "ww",Date.today) & "周")
app.Visible = True
catch ex As exception
msgbox(ex.message)
app.Quit
End try
Dim fdr As DataRow = DataTables("日计划").Find("日期 = '" & Date.Today & "'")
If fdr IsNot Nothing Then
fdr("学习科目") &= Tables("计划表窗口_Table7").Current("学习名称") & ";"
End If
Tables("计划表窗口_Table7").Current("最近日期")=Date.now '记录学习时间
End If