Hello all,
I really need your help to convert this script that i put together and tested (works ok),but in late binding since the users have different versions of Outlook and right now it works only with outlook reference activated.
The code does a simple thing - takes the current opened e-mail and allows the user to add other e-mail address to the .To and .CC ( actually it adds a recordset build separately by the user,but for this situation the code is with some general examples ).
Keeping things short,if i disable outlook reference i get a compile error for
.
All the help will be greatly appreciated.
I really need your help to convert this script that i put together and tested (works ok),but in late binding since the users have different versions of Outlook and right now it works only with outlook reference activated.
The code does a simple thing - takes the current opened e-mail and allows the user to add other e-mail address to the .To and .CC ( actually it adds a recordset build separately by the user,but for this situation the code is with some general examples ).
Keeping things short,if i disable outlook reference i get a compile error for
Code:
Dim myEmail As Inspector
All the help will be greatly appreciated.
Code:
Private Sub Toggle1_Click()
Dim myEmail As Inspector
Dim SaveEmail As Object
Dim strName As String
'Search for open mail
Set myEmail = Outlook.Application.ActiveInspector
If Not TypeName(myEmail) = "Nothing" Then
Set SaveEmail = myEmail.currentItem
Else
MsgBox "No open mail has been detected" & Chr(13) & _
"If you wish to add an email, you will have " & Chr(13) & _
"to open the mail.", vbOKOnly, "No open mail detected"
End If
With SaveEmail
' this keeps the existing address and adds with the command below something else
string1 = .To
.To = string1 & " ; " & "whatever"
.CC = "something"
.Display
End With
End Sub