s3.amazonaws 下载慢:听说有可以把WORD中的文字度出来?我坐了不可以的,急!

来源:百度文库 编辑:中科新闻网 时间:2024/05/03 11:49:49
”语音输入”和”MRICOSOFT输入法”并用就可以了
文章见:
电脑爱好者,第三期,具体怎么做呢?

2002以上版本, 且本机装有Excel2002及以上:

在 Word 中按下 Alt+F11 组合键打开VBA 工程窗口,
在 ThisDocument 中键入下列代码:
Option Explicit

' 在文档关闭前删除本文自定义的工具栏及菜单
' 而不论其是否已被删除.
Private Sub Document_Close()

On Error Resume Next

CommandBars("文本朗读").Delete
CommandBars("Tools").Controls("朗读文本(&R)").Delete

End Sub

' 在文档开启时创建朗读工具栏及菜单
Private Sub Document_Open()
Dim myCmdBar As CommandBar
Dim mybtn As CommandBarButton

On Error Resume Next

' 不移除原文件个人信息, XP 有效
ActiveDocument.RemovePersonalInformation = False

' 创建自定义工具栏
Set myCmdBar = CommandBars(CMDBAR_NAME)
If myCmdBar Is Nothing Then

' 设定工具栏位置及显示方式
Set myCmdBar = CommandBars.Add(Name:=CMDBAR_NAME, Position:=msoBarFloating, Temporary:=True)
With myCmdBar
.Left = 600
.Top = 160
.Width = 100
.Visible = True
.Protection = msoBarNoChangeVisible

' 添加命令按钮
Set mybtn = .Controls.Add(Type:=msoControlButton, Before:=1)
With mybtn
.FaceId = 68
.Caption = "朗读文本(&R)"
.Style = msoButtonIconAndCaption
.OnAction = "ReadTheSelection"
.Copy Bar:=CommandBars("Tools"), Before:=7
End With

End With

End If

Set mybtn = Nothing
Set myCmdBar = Nothing
End Sub

在模块(新建一个)中键入下列代码:
Option Explicit
Public Const CMDBAR_NAME As String = "文本朗读"
Public Sub ReadTheSelection()
' 由 VBA 代码注释器和错误处理程序外接程序插入的代码头
'=============================================================
' Comm.ReadTheSelection
'-------------------------------------------------------------
' 目的 : 利用 Excel 中的语言功能朗读 Word 中选中的文本
' 作者 : Rowen Gu, 2002年7月21日
' 说明 :
'-------------------------------------------------------------
' 参数
'-----------
' 无
'-------------------------------------------------------------
' 返回:
'-------------------------------------------------------------
' 修订历史
'-------------------------------------------------------------
' 2002年7月21日 GB:
'=============================================================
' 代码头块结束

Dim xlApp As Object
Dim str2BeSpeakOut As String

On Error Resume Next

str2BeSpeakOut = Selection

' 选中的是有效文本吗?
If str2BeSpeakOut = "" Or Asc(str2BeSpeakOut) = 13 Then _
str2BeSpeakOut = "请选中有效文本以供朗读。"

Set xlApp = CreateObject("excel.Application")

' 版本不够时使用文本来提示用户
If xlApp.Version >= 10 Then

' 开始朗读
With xlApp
.Speech.Speak str2BeSpeakOut
.Quit
End With

Else

MsgBox "本例部分功能需要 Office XP 以上版本的支持," & vbCrLf & _
"请升级您的 Office 版本以体验新特性."

End If

Set xlApp = Nothing

End Sub

保存>>关闭>>再打开,就可以阅读你在 Word 中选中的文本了。

有关语音命令的问题:
工具>>语音

建议开始时进行必要的语音训练,建议再观看一遍随机提供的有关该功能的视频帮助:..\Program Files\Microsoft Office\OFFICE11\2052\VIDEO.MHT