View Single Post
  #5  
Old October 9th 08, 09:33 AM posted to microsoft.public.outlook.program_addins
SOPHIE
external usenet poster
 
Posts: 21
Default attachment preview


Thanks, Ken.

I have resolve this problem in another way.

I found that if i remove or add the attachment when user check the
attachment list, it will be much easy. And it works all right.

Thanks again.

"Ken Slovak - [MVP - Outlook]" wrote:

The code doesn't show it but I assume that objMailItem is set previous to
any of those methods or event handlers being called?

I don't see where you're saving the item after modifying it by
removing/adding attachments, have you tried that?

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"sophie" wrote in message
...
Thanks Ken.

The code in double click attachment name:
Private Sub listFileName_DblClick()
Dim fileIndex As Long
fileIndex = Me.ListFileName.SelectedItem.index
Dim objTemp As Outlook.MailItem
Set objTemp = objMailItem

selfile = strTempDir & "\" & Me.ListFileName.SelectedItem.Text
lResult = ShellExecute(0, "Open", selfile, vbNull, vbNull, 1)

objTemp.Attachments.Remove (fileIndex)
objTemp.Attachments.Add (selfile)
Set objMailItem = objTemp
End Sub

Private Sub ListFileNmae_ItemCheck(ByVal Item As MSComctlLib.ListItem)
Dim bOkEnabled As Boolean
Dim objItem as MSConctlLib.listItem
bOkEnabled = true
For Each objItem In Me.ListFileName.ListItems
bOkEnabled =bOkEnabled and objItem.Checked
Next objItem
me.Okbutton.Enabled =bOkEnabled
End Sub

Private sub Okbutton_click()
Dim objTemp as Outlook.MailItem
set objTem =objMailItem

If Not (objTemp Is Nothing) Then
bConfirmed = true
objTemp.send
bConfirmed =false
objTemp.Close
set objTemp= nothing
End If
End sub

there are a list of attachment. After i have check them, it will be sent.



Ads