#  Other Applications & Softwares  > Outlook Formatting & Functions >  >  Modify VBA to save attachment with Subject line as file name??

## dwhite30518

I have the following VBA code that I am currently using in my Outlook to save particular attachments from specific senders.  However, currently the program using the name of the attachment and I want to change that to use a portion of the subject as the file name.  I am unsure how to properly change this code to do everything the same but this time use the subject line as the file name...suggestions???





```
Please Login or Register  to view this content.
```

----------


## daffodil11

Here you go. The subject is derived from objMsg.Subject. From there we add in an array of invalid filename characters, and cycle each email's subject string to remove them.




```
Please Login or Register  to view this content.
```

----------


## hudson andrew

Hi Daffodil,

This is Brilliant , I was in sought of similar kind of requirement . 

can you also help me with the same change in the code that I have , which I brought from online , need tweak that can help me to save email attachment that using my subject . below is the code for your reference .



```
Please Login or Register  to view this content.
```




appreciate your assistance.

----------

