Excel vba 응용 프로그램의이 하위 프로그램은 수년간 잘 작동하여 보내려는 전자 메일 (.Display)을 표시하기 전에 Outlook 서명을 전자 메일에 삽입했습니다. 이 기능은 Excel 2007의 XL 2007 및 Windows 7의 2013에서 작동합니다.Excel에서 vba를 사용하여 전자 메일 서명 삽입
이제 Windows 8.1 및 Office 2013을 사용하면 오류 루틴에 오류 91이 발생합니다. 참고 문헌 중 하나에 문제가 될 수 있습니까? - 또는 코드에서 약간의 변경이 필요합니까? 모든 도움을 기꺼이 받아 들였습니다! 오류 루틴을 사용하지 않는 디버깅 할 때
Sub InsertSig2007(strSigName As String)
Dim objItem As Object
Dim objInsp As Outlook.Inspector
' requires a project reference to the
' Microsoft Office library
Dim objCBP As Office.CommandBarPopup
Dim objCBP2 As Office.CommandBarPopup
Dim objCBB As Office.CommandBarButton
Dim colCBControls As Office.CommandBarControls
Set objInsp = ActiveInspector
If Not objInsp Is Nothing Then
Set objItem = objInsp.CurrentItem
If objItem.Class = olMail Then
' get Insert menu
Set objCBP = objInsp.CommandBars.ActiveMenuBar.FindControl(, 30005)
' get Signature submenu
Set objCBP2 = objCBP.CommandBar.FindControl(, 5608)
If Not objCBP2 Is Nothing Then
Set colCBControls = objCBP2.Controls
For Each objCBB In colCBControls
Debug.Print objCBB.Caption
If objCBB.Caption = strSigName Then
objCBB.Execute ' **** see remarks
Exit For
End If
Next
End If
End If
End If
Set objInsp = Nothing
Set objItem = Nothing
Set colCBControls = Nothing
Set objCBB = Nothing
Set objCBP = Nothing
Set objCBP2 = Nothing
최종 하위
은 매우 부서지기 쉬운 보인다. 어떤 라인이 실패합니까? – Bathsheba