1000字范文,内容丰富有趣,学习的好帮手!
1000字范文 > vba 添加outlook 签名_在Excel 中使用vba插入电子邮件签名

vba 添加outlook 签名_在Excel 中使用vba插入电子邮件签名

时间:2023-04-27 13:50:03

相关推荐

vba 添加outlook 签名_在Excel 中使用vba插入电子邮件签名

“这在我的错误例程中出现错误91”当调试时不使用错误例程 . 通过这种方式,您可以看到问题所在并可以说出问题所在 .

可能是

Set objCBP = mandBars.ActiveMenuBar.FindControl(, 30005)

见CommandBars.FindControl Method (Office) "The use of CommandBars in some Microsoft Office applications has been superseded by the new ribbon component of the Microsoft Office Fluent user interface."

可能这个:

Sub Mail_Outlook_With_Signature_Html_2()

' Don't forget to copy the function GetBoiler in the module.

' Working in Office 2000-

'Dim OutApp As Object

Dim OutMail As Object

Dim strbody As String

Dim SigString As String

Dim Signature As String

'Set OutApp = CreateObject("Outlook.Application")

'Set OutMail = OutApp.CreateItem(0)

Set OutMail = CreateItem(0)

strbody = "

Dear Customer Ron de Bruin

" & _

"Please visit this website to download the new version.

" & _

"Let me know if you have problems.

" & _

"Ron's Excel Page" & _

"Thank you"

'Change only Mysig.htm to the name of your signature

SigString = Environ("appdata") & _

"\Microsoft\Signatures\Mysig.htm"

If Dir(SigString) <> "" Then

Signature = GetBoiler(SigString)

Else

Signature = ""

End If

On Error Resume Next

With OutMail

'.To = "ron@debruin.nl"

.CC = ""

.BCC = ""

.Subject = "This is the Subject line"

.HTMLBody = strbody & "

" & Signature

'.Send

'or use

.Display

End With

On Error GoTo 0

Set OutMail = Nothing

'Set OutApp = Nothing

End Sub

Function GetBoiler(ByVal sFile As String) As String

'Dick Kusleika

Dim fso As Object

Dim ts As Object

Set fso = CreateObject("Scripting.FileSystemObject")

Set ts = fso.GetFile(sFile).OpenAsTextStream(1, -2)

GetBoiler = ts.readall

ts.Close

End Function

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。