Attribute VB_Name = "SetWord"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Private mywdapp As Word.Application
Private mysel As Object
'属性值的模块变量
Private C_TemplateDoc As String
Private C_newDoc As String
Private C_PicFile As String
Private C_ErrMsg As Integer
Public Event HaveError()
Attribute HaveError.VB_Description = "出错时激发此事件.出错代码为 ErrMsg 属性"
'***************************************************************
'ErrMsg 代码:1-word 没有安装 2 - 缺少参数 3 - 没权限写文件
' 4 - 文件不存在
'
'***************************************************************
Public Function ReplacePic(FindStr As String, Optional Time As Integer = 0) As Integer
Attribute ReplacePic.VB_Description = "查找 FindStr,并替换为 PicFile 所指向的图片文件,
替换次数由 time 参数确定,为 0 时,替换所有"
'********************************************************************************
' 从 Word.Range 对象 mysel 中查找所有 FindStr,并替换为 PicFile 图像