Am I an email enclosure?

  • Thread starter Thread starter ZipCurs
  • Start date Start date
Z

ZipCurs

I am looking for a way to tell if an open Excel file is an email enclosure.
Is there a way to do this? Thanks in advance for any help.
 
Try the below. If this is pointing to you temporary folder then the open
workbook is opened from an email.

Activeworkbook.FullNameURLEncoded
 
Jacob,

Thanks, this is a good start. I guess the real question is how do I know
that it is a temporary folder? Any folder can be named "temporary", correct?

Thanks in advance for any additional help.
 
If you try and open an excel file from your email and try ActiveWorkbook.Path
it will return. Also the file will be opened in Read-only mode. So you can
probably can validate these two...

C:\Documents and Settings\<username>\Local Settings\Temporary Internet Files\

If Instr(1,activeworkbook.path,"Temporary Internet Files",vbTextCompare)>0
Then

If Activeworkbook.ReadOnly = True Then
Msgbox "File opened from Email"
End If

Else

Msgbox "File residing in" & ActiveWorkbook.Path

End If


If this post helps click Yes
 
Jacob,

That did the job. Thank you.

Jacob Skaria said:
If you try and open an excel file from your email and try ActiveWorkbook.Path
it will return. Also the file will be opened in Read-only mode. So you can
probably can validate these two...

C:\Documents and Settings\<username>\Local Settings\Temporary Internet Files\

If Instr(1,activeworkbook.path,"Temporary Internet Files",vbTextCompare)>0
Then

If Activeworkbook.ReadOnly = True Then
Msgbox "File opened from Email"
End If

Else

Msgbox "File residing in" & ActiveWorkbook.Path

End If


If this post helps click Yes
 
Back
Top