setting the Paperclip?

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
 
K

Ken Slovak - [MVP - Outlook]

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)
 
M

MatrimCauthon

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
 
M

MatrimCauthon

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
 
M

MatrimCauthon

Thank you a lot,

finally I got it going.

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

Mat
 
M

MatrimCauthon

Thank you a lot,

finally I got it going.

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

Mat
 
M

MatrimCauthon

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
 
M

MatrimCauthon

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
 
K

Ken Slovak - [MVP - Outlook]

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
 
Top