setting the Paperclip?

  • Thread starter Thread starter MatrimCauthon
  • Start date Start date
M

MatrimCauthon

Hello,

is there a way I can make outlook to show the attachment papercli
although there are no (accessible) attachments in the mail (item)?

I was about to add an empty file as an attachment but I can't figur
out how to make it inaccessible or hidden.

Could this possible work (and how)?

Or is this all more easy just setting a property I don't know of ?

Thank you in advance,

Mat
 
Go to http://www.dimastr.com/redemption/ and click on the Redemption
objects button and scroll down to the example of creating a message
with an embedded image. That shows the undocumented property tag you
have to manipulate to show or hide the paperclip icon: PR_HIDE_ATTACH
(("{00062008-0000-0000-C000-000000000046}", &H8514) or 11)
 
I was about to get it going without Redemption.
To see how it is really done, you know.

But maybe I can play a little bit around and get access to tha
undocumented property.

Thank you so far,

Mat
 
I was about to get it going without Redemption.
To see how it is really done, you know.

But maybe I can play a little bit around and get access to tha
undocumented property.

Thank you so far,

Mat
 
Thank you a lot,

finally I got it going.

Although the message size itself increases about 3kBytes to 4kBytes.

Mat
 
Thank you a lot,

finally I got it going.

Although the message size itself increases about 3kBytes to 4kBytes.

Mat
 
Hallo,

it seems I was a little bit to enthusiastic =(

In fact as long as I dont log out of Outlook, everything seems okay.
But as soon as I restart the former hidden attachment isn't actuall
hidden anymore altough I call mapiMessage.Update().

(I add the attachment with CDO and manipulate as suggested th
PR_HIDDEN_ATTACHMENT thing)

Any ideas?

Mat, kinda puzzle
 
Hallo,

it seems I was a little bit to enthusiastic =(

In fact as long as I dont log out of Outlook, everything seems okay.
But as soon as I restart the former hidden attachment isn't actuall
hidden anymore altough I call mapiMessage.Update().

(I add the attachment with CDO and manipulate as suggested th
PR_HIDDEN_ATTACHMENT thing)

Any ideas?

Mat, kinda puzzle
 
It works here just fine, even after exiting and restarting Outlook. I didn't
use any CDO code, I used straight Redemption code as follows, with a dummy
text file as my attachment:

Sub paperclip()
Dim DraftsFolder As Outlook.MAPIFolder
Dim oMailItem As Outlook.MailItem
Dim sItem As Redemption.SafeMailItem
Dim Attach As Redemption.Attachment
Dim PR_HIDE_ATTACH As Long

Const PT_BOOLEAN = 11

On Error Resume Next

Set DraftsFolder = Application.Session.GetDefaultFolder(16)
Set oMailItem = DraftsFolder.items.Add
Set sItem = CreateObject("Redemption.SafeMailItem")
sItem.item = oMailItem

'tell Outlook to hide the paperclip icon
'this is a named prop, so we must call GetIDsFromNames() first!
PR_HIDE_ATTACH =
sItem.GetIDsFromNames("{00062008-0000-0000-C000-000000000046}", &H8514) Or
PT_BOOLEAN
sItem.Fields(PR_HIDE_ATTACH) = True

'add attachment
Set Attach = sItem.Attachments.Add("c:\test.txt")
sItem.Body = "attachment test"
sItem.Subject = "Attachment Test"
sItem.Save

'IMPORTANT - dereference everything
Set Attach = Nothing
Set sItem = Nothing
Set oMailItem = Nothing
Set DraftsFolder = Nothing
End Sub
 
Ken said:
*It works here just fine, even after exiting and restarting Outlook
I didn't
use any CDO code, I used straight Redemption code as follows, with
dummy
text file as my attachment:*

Thats the problem I dont want to use Redemption, I wan't to stay a
pure as possible meaning I want to understand what is done instead o
using 3rd party code which isn't free.

Otherwise Im pretty sure this would work.
Is there a way to achieve this without Redemption?

Mat.
 
Just translate the code I wrote from Redemption to CDO then. It's not hard,
almost a one-to-one correlation if that's what you want.

You can't do what you want using the Outlook object model, your choices
would be CDO 1.21 or Extended MAPI code or Redemption code. MAPI can only be
programmed using C++ or Delphi. Redemption is a 3rd party library but it
allows bypassing the security restrictions as does MAPI. CDO 1.21 is an
optional installation for Outlook 2000 and later so you can't be sure it's
installed, although you can force a demand installation of it, and it's
subject to the security restrictions.

Your choice.
 
Back
Top