回复 1# szlanpa #Region ;**** 参数创建于 ACNWrapper_GUI ****
#PRE_icon=..\..\..\..\Program Files\Microsoft Office\Office14\protocolhandler.exe|-1
#PRE_Outfile=ODF.exe
#PRE_Res_requestedExecutionLevel=None
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#include <GUIConstantsEx.au3>
ODF()
Func ODF()
Local $Button1,$Button2,$Button3,$Button4,$msg
$owordver = ObjCreate("Word.Application.8")
$OfficeVer = $owordver.Version
If $OfficeVer ="12.0" Then
MsgBox(0,"温馨提示","您的Office版本为Office 2007,请运行Office 2007脚本")
ElseIf $OfficeVer ="14.0" Then
MsgBox(0,"温馨提示","您的Office版本为Office 2010,请运行Office 2010脚本")
EndIf
GUICreate("Office兼容模式切换助手",280,230)
GUISetState(@SW_SHOW)
GUICtrlCreateLabel("Office 2010",5,10)
GUICtrlCreateLabel("Office 2007",5,70)
GUICtrlCreateLabel("使用说明:",5,130)
GUICtrlCreateLabel("工具适用范围(Word,Excel,PowerPoint)",5,150)
GUICtrlCreateLabel("保存兼容模式:新建文档默认保存为Office2003格式",5,170)
GUICtrlCreateLabel("还原默认模式:将文档默认保存恢复为原有格式",5,190)
$Button1=GUICtrlCreateButton("保存兼容模式",25,30)
$Button2=GUICtrlCreateButton("还原默认模式",135,30)
$Button3=GUICtrlCreateButton("保存兼容模式",25,90)
$Button4=GUICtrlCreateButton("还原默认模式",135,90)
If $OfficeVer ="12.0" Then
GUICtrlSetState($Button1, $GUI_DISABLE)
GUICtrlSetState($Button2, $GUI_DISABLE)
EndIf
If $OfficeVer ="14.0" Then
GUICtrlSetState($Button4, $GUI_DISABLE)
GUICtrlSetState($Button3, $GUI_DISABLE)
EndIf
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE ;点击关闭按钮,窗口关闭
ExitLoop
Case $msg = $Button1
Run('Office2010.bat') ; 点击按钮 1 运行office 2007兼容脚本
Case $msg = $Button2
Run('Office2010_bak.bat') ; 点击按钮 2 运行office 2007还原默认脚本
Case $msg = $Button3
Run('Office2007.bat') ; 点击按钮 3 运行office 2010兼容脚本
Case $msg = $Button4
Run('Office2007_bak.bat') ; 点击按钮 4 运行office 2010还原默认脚本
EndSelect
WEnd
EndFunc
|