PC Review


Reply
Thread Tools Rate Thread

Can I replace the attachment file when double chick attachment?

 
 
swzhengst@gmail.com
Guest
Posts: n/a
 
      3rd Aug 2006
I want to replace the attachment when double chick the attachment. I
use outlook form to do it.
Beause attachment read in outlook is not a cancelable event, I can't do
it directly.

I found outlook always store attachments file in directory:
"%USERPROFILE%\Local Settings\Temporary Internet Files\OLK*".
So if I want to replace the attachment when user double chick the
attachment, I can repalce the attachment file(will display) in that
directory.

I have some test, outlook allow me do that. But I meet two question:
First: the directory is different with each user, I always start with
the work I type before and end with a random value. How can I get the
exactly value of it in vbscript?

Second. When user chick the attachment, outlook will download the
attachment and save to the directory with the name: attachment
filename(number). If I have a attachment name "aaa.txt", it maybe save
with "aaa(10).txt". Can I get the exactly name of it?

 
Reply With Quote
 
 
 
 
Lanwench [MVP - Exchange]
Guest
Posts: n/a
 
      3rd Aug 2006


In news:(E-Mail Removed),
(E-Mail Removed) <(E-Mail Removed)> typed:
> I want to replace the attachment when double chick the attachment. I
> use outlook form to do it.
> Beause attachment read in outlook is not a cancelable event, I can't
> do it directly.
>
> I found outlook always store attachments file in directory:
> "%USERPROFILE%\Local Settings\Temporary Internet Files\OLK*".
> So if I want to replace the attachment when user double chick the
> attachment, I can repalce the attachment file(will display) in that
> directory.
>
> I have some test, outlook allow me do that. But I meet two question:
> First: the directory is different with each user, I always start with
> the work I type before and end with a random value. How can I get the
> exactly value of it in vbscript?
>
> Second. When user chick the attachment, outlook will download the
> attachment and save to the directory with the name: attachment
> filename(number). If I have a attachment name "aaa.txt", it maybe save
> with "aaa(10).txt". Can I get the exactly name of it?


Hi - unfortunately, I'm not sure I understand what it is you're trying to
do. You can't really control what happens to your mail once the user
receives it. Can you not just instruct the users to save the attachment
rather than merely opening it?


 
Reply With Quote
 
swzhengst@gmail.com
Guest
Posts: n/a
 
      3rd Aug 2006
What I want to do is: when user double click a attachment, chick open
in the Open, Save, Cancel dialog. normally it will display the
attachment file.
Now what I want to do is replace the file, display another file to
user.

So I do some code in Item_AttachmentRead() in outlook form, but the
AttachmentRead isn't a cancelable event. what ever I code in this
function, outlook will display the original attachment file after all.

But I found another way to do that: when the user double click a
attachment, click open, then outlook will download the attachment into
a Temporary directory, it's path is: "%USERPROFILE%\Local
Settings\Temporary Internet Files\OLK*", with filename: attachment
filename(number). then outlook will run the Item_AttachmentRead()
method, after that display the attachment file. So I think I can write
some code into Item_AttachmentRead() to replace the downloaded
Temporary attachments file in the Temporary directory.

So if I can get the "%USERPROFILE%\Local Settings\Temporary Internet
Files\OLK*" and the attachment filename(number), I can replace the
attachment to display.

My question is how can the get the exactly value of
"%USERPROFILE%\Local Settings\Temporary Internet Files\OLK*" and
attachment filename(number).

I have another question: If use double chick a attachment, then chick
save button in Open, Save, Cancel dialog, then save the attachment to a
disk, I can do nothing in this steps. I found BeforeAttachmentSave is
not work here. Is there any way I can do the purpose like
before(replace the attachment)? OR can I prevent user chick the
attachment(double chick and right chick)?

My outlook is outlook 2003. The code I want to write in is outlook
form.

Lanwench [MVP - Exchange] wrote:
> In news:(E-Mail Removed),
> (E-Mail Removed) <(E-Mail Removed)> typed:
> > I want to replace the attachment when double chick the attachment. I
> > use outlook form to do it.
> > Beause attachment read in outlook is not a cancelable event, I can't
> > do it directly.
> >
> > I found outlook always store attachments file in directory:
> > "%USERPROFILE%\Local Settings\Temporary Internet Files\OLK*".
> > So if I want to replace the attachment when user double chick the
> > attachment, I can repalce the attachment file(will display) in that
> > directory.
> >
> > I have some test, outlook allow me do that. But I meet two question:
> > First: the directory is different with each user, I always start with
> > the work I type before and end with a random value. How can I get the
> > exactly value of it in vbscript?
> >
> > Second. When user chick the attachment, outlook will download the
> > attachment and save to the directory with the name: attachment
> > filename(number). If I have a attachment name "aaa.txt", it maybe save
> > with "aaa(10).txt". Can I get the exactly name of it?

>
> Hi - unfortunately, I'm not sure I understand what it is you're trying to
> do. You can't really control what happens to your mail once the user
> receives it. Can you not just instruct the users to save the attachment
> rather than merely opening it?


 
Reply With Quote
 
Lanwench [MVP - Exchange]
Guest
Posts: n/a
 
      3rd Aug 2006


In news:(E-Mail Removed),
(E-Mail Removed) <(E-Mail Removed)> typed:
> What I want to do is: when user double click a attachment, chick open
> in the Open, Save, Cancel dialog. normally it will display the
> attachment file.
> Now what I want to do is replace the file, display another file to
> user.
>
> So I do some code in Item_AttachmentRead() in outlook form, but the
> AttachmentRead isn't a cancelable event. what ever I code in this
> function, outlook will display the original attachment file after all.
>
> But I found another way to do that: when the user double click a
> attachment, click open, then outlook will download the attachment into
> a Temporary directory, it's path is: "%USERPROFILE%\Local
> Settings\Temporary Internet Files\OLK*", with filename: attachment
> filename(number). then outlook will run the Item_AttachmentRead()
> method, after that display the attachment file. So I think I can write
> some code into Item_AttachmentRead() to replace the downloaded
> Temporary attachments file in the Temporary directory.
>
> So if I can get the "%USERPROFILE%\Local Settings\Temporary Internet
> Files\OLK*" and the attachment filename(number), I can replace the
> attachment to display.
>
> My question is how can the get the exactly value of
> "%USERPROFILE%\Local Settings\Temporary Internet Files\OLK*" and
> attachment filename(number).
>
> I have another question: If use double chick a attachment, then chick
> save button in Open, Save, Cancel dialog, then save the attachment to
> a disk, I can do nothing in this steps. I found BeforeAttachmentSave
> is not work here. Is there any way I can do the purpose like
> before(replace the attachment)? OR can I prevent user chick the
> attachment(double chick and right chick)?


You can't do that as far as I know. (and I think you mean click, not chick
! ) You should probably post this in an Outlook developer's group for more
help, I think.
>
> My outlook is outlook 2003. The code I want to write in is outlook
> form.
>
> Lanwench [MVP - Exchange] wrote:
>> In news:(E-Mail Removed),
>> (E-Mail Removed) <(E-Mail Removed)> typed:
>>> I want to replace the attachment when double chick the attachment. I
>>> use outlook form to do it.
>>> Beause attachment read in outlook is not a cancelable event, I can't
>>> do it directly.
>>>
>>> I found outlook always store attachments file in directory:
>>> "%USERPROFILE%\Local Settings\Temporary Internet Files\OLK*".
>>> So if I want to replace the attachment when user double chick the
>>> attachment, I can repalce the attachment file(will display) in that
>>> directory.
>>>
>>> I have some test, outlook allow me do that. But I meet two question:
>>> First: the directory is different with each user, I always start
>>> with the work I type before and end with a random value. How can I
>>> get the exactly value of it in vbscript?
>>>
>>> Second. When user chick the attachment, outlook will download the
>>> attachment and save to the directory with the name: attachment
>>> filename(number). If I have a attachment name "aaa.txt", it maybe
>>> save with "aaa(10).txt". Can I get the exactly name of it?

>>
>> Hi - unfortunately, I'm not sure I understand what it is you're
>> trying to do. You can't really control what happens to your mail
>> once the user receives it. Can you not just instruct the users to
>> save the attachment rather than merely opening it?



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Attachment Problem - different file name, same attachment Disco Stu Microsoft Outlook Discussion 2 1st Apr 2008 02:35 AM
Can open attachment -- when attachment is Outlook file! honkaphrodite Microsoft Outlook Discussion 4 19th Feb 2008 02:33 PM
Sorry: meant CAN'T open attachment when attachment is Outlook file honkaphrodite Microsoft Outlook Discussion 1 18th Feb 2008 08:36 PM
wrong file attachment opens in mutliple attachment message =?Utf-8?B?Q2xpZl9H?= Microsoft Outlook Discussion 1 2nd Nov 2006 05:30 AM
double click attachment opens file =?Utf-8?B?Sy4gQ3JhbmU=?= Microsoft Outlook Discussion 2 20th Dec 2004 04:39 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:51 AM.