View Single Post
  #1  
Old June 15th 11, 07:00 PM
Bendo Bendo is offline
Junior Member
 
First recorded activity at Outlookbanter: Jun 2011
Posts: 1
Default Code to Attach File - Not Working in Outlook '07

I have an Outlook form that was created in Outlook 2003 and everything worked fine. There is a custom button on the form to launch a file attachment dialog. We use the separate button because there is code that goes along with the attach action that wipes out the body of the email prior to attaching the document and then inserts some default messaging after the attachment.

Anyway, we're switching to Outlook '07 and the code to launch the attach dialog is no longer working (I assume because the original code used the Outlook menu as a reference, which has changed.) Any idea on what the correct code would be for Outlook '07?

Sub ShowAttachmentDialog()
Dim objInsp
Dim colCB
Dim objCBB
On Error Resume Next
Set objInsp = Item.GetInspector
Set colCB = objInsp.CommandBars
Set objCBB = colCB.FindControl(, 1079)
If Not objCBB Is Nothing Then
objCBB.Execute
End If
Set objCBB = Nothing
Set colCB = Nothing
Set objInsp = Nothing
End Sub
Ads