+ Reply to Thread
Results 1 to 5 of 5

Block email address from attaching file

  1. #1
    Forum Contributor
    Join Date
    05-25-2019
    Location
    Sioux Falls, South Dakota
    MS-Off Ver
    Microsoft 365
    Posts
    188

    Block email address from attaching file

    I wrote the following code to prevent the email containing "@lifebloodsd.org" in the address of the person attempting to attach the excel workbook from a folder in a server. However, it does not work. How could this be rewritten differently so that it will work?

    Please Login or Register  to view this content.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,995

    Re: Block email address from attaching file

    This code does not remotely match what your post describes.

    The code prevents a user from saving this Excel file if the title bar contains "lifebloodsd" which would happen only if that string is part of the Excel file name.

    There is no way to write code in an Excel file to prevent a person from attaching that Excel file to an email. When attaching a file to an email, the file is not opened and if it has code the code does not run.
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Contributor
    Join Date
    05-25-2019
    Location
    Sioux Falls, South Dakota
    MS-Off Ver
    Microsoft 365
    Posts
    188

    Re: Block email address from attaching file

    Thanks for explaining that. Did not realize attachments are not opened first when linked to an email address.

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,995

    Re: Block email address from attaching file

    Not sure what you mean by "linked to an email address". Here is the process in some detail.

    You Create New email. Your email client creates an object that is the email, and presents it to you for editing.
    You click Attach a file. You navigate to the file and click OK.
    The email client makes a copy of that file and inserts it into the email. (This is done by encoding the file into ASCII characters but I'm not going to get into the details.)
    You click Send and the email is sent.

    The file is never opened during this process. It's similar to copying a file from one place to another on your computer. The file never has to be opened to do that.

  5. #5
    Forum Contributor
    Join Date
    05-25-2019
    Location
    Sioux Falls, South Dakota
    MS-Off Ver
    Microsoft 365
    Posts
    188

    Re: Block email address from attaching file

    Yes, that does make sense. I see that the word "linked" is the wrong term to use in this case.

    So, a file essentially is incapable of doing anything unless it is opened. I had hoped file could be made to tell a certain email address to bug off when it tries to make copies of it. Something else will be needed to come in and shield off the email address from copying.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Save excel file w/o prompts before attaching to email
    By cmorten82 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-26-2018, 05:16 PM
  2. [SOLVED] How to prevent VBA from attaching a particular file when it generates email
    By bdouglas1011 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-17-2018, 07:41 PM
  3. Attaching an embedded PDF file in my worksheet to a new email
    By AnthonyGFS in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-14-2017, 04:24 AM
  4. [SOLVED] VBA code exporting to PDF but not attaching the file to the email.
    By michelle 1 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-24-2016, 03:11 AM
  5. Email (outlook) recipients attaching specific file name.
    By monkeypants in forum Outlook Formatting & Functions
    Replies: 1
    Last Post: 05-13-2015, 07:18 PM
  6. Email (outlook) recipients attaching specific Excel file name.
    By monkeypants in forum Outlook Formatting & Functions
    Replies: 0
    Last Post: 05-13-2015, 07:14 PM
  7. Attaching One Worksheet of a File to Email
    By MLCall in forum Excel General
    Replies: 0
    Last Post: 01-17-2012, 12:51 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1