本文介绍了运行时错误5941当我想使用加载项模板时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用加载项模板。当我想使用它时,会显示以下消息: 运行时错误5941:集合的请求成员不存在。当我点击debug时,这是windows中的消息:
$


Public Sub BuildcharDown(diacr As String)

Dim exists As Boolean ,s As String,s2 As String,istr As String,tnum As Integer

For I = 1 To Templates.Count

If Templates(I).Name =" uniqoder.dot"然后

tnum = I

结束如果

下一个I

如果Selection.MoveLeft(wdCharacter,1,wdExtend )然后

s = Selection.Range.Text

如果s =" "那么s ="mod"

如果是InStr("ABCDEFGHIJKLMNOPQRSTUVWXYZ",s)那么

s2 = LCase(s)

如果是s2 <> s然后s ="!" &安培; s2

结束如果

s ="!" &安培; s& diacr

如果InsertAutotextIfExists(tnum,s)= False则为
  &NBSP; Selection.Collapse(wdCollapseEnd)

  &NBSP; Selection.Font.Position = h

  &NBSP;模板(tnum).AutoTextEntries("!"& diacr).Insert _

  &NBSP;其中:= Selection.Range

  &NBSP; Selection.Collapse(wdCollapseEnd)

  &NBSP; Selection.Font.Position = 0

  &NBSP;结束如果



结束如果

结束子

$


突出显示的部分是:

模板(tnum).AutoTextEntries("!"& diacr)。插入_

  &NBSP; Where:= Selection.Range



我该怎么办?



谢谢。

解决方案

I want to use an add-ins template. When I want to use it, this message appears:  runtime error 5941: the requested member of the collection does not exist. When I click on debug, this is the message in the windows:

Public Sub BuildcharDown(diacr As String)
Dim exists As Boolean, s As String, s2 As String, istr As String, tnum As Integer
For I = 1 To Templates.Count
If Templates(I).Name = "uniqoder.dot" Then
tnum = I
End If
Next I
If Selection.MoveLeft(wdCharacter, 1, wdExtend) Then
s = Selection.Range.Text
If s = " " Then s = "mod"
If InStr("ABCDEFGHIJKLMNOPQRSTUVWXYZ", s) Then
s2 = LCase(s)
If s2 <> s Then s = "!" & s2
End If
s = "!" & s & diacr
If InsertAutotextIfExists(tnum, s) = False Then
    Selection.Collapse (wdCollapseEnd)
    Selection.Font.Position = h
    Templates(tnum).AutoTextEntries("!" & diacr).Insert _
    Where:=Selection.Range
    Selection.Collapse (wdCollapseEnd)
    Selection.Font.Position = 0
    End If

End If
End Sub


Highlighted section is:
Templates(tnum).AutoTextEntries("!" & diacr).Insert _
    Where:=Selection.Range

What should I do?

Thanks.

解决方案


这篇关于运行时错误5941当我想使用加载项模板时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 22:27