cancel
Showing results for 
Search instead for 
Did you mean: 
6 Replies

Re: Set filename equal to the subject in an e-mail

In one line: filename = email.subject

 

0 Kudos
Mario36
New Member
New Member

Re: Set filename equal to the subject in an e-mail

To assign the subject of an email to a variable called "filename," you would need to access the email through an email client or API. However, as an AI language model, I don't have direct access to your email inbox. You would need to provide more specific details about your email client or API for me to assist you with the code or instructions to retrieve the subject and assign it to the "filename" variable.

 

0 Kudos

Re: Set filename equal to the subject in an e-mail

To set the filename of an email attachment to the subject of the email, you can use VBA (Visual Basic for Applications) in Microsoft Outlook. Here's an example code you can use:

  1. Open the email that you want to add an attachment to.
  2. Press Alt + F11 to open the VBA editor.
  3. Go to "Insert" and choose "Module".
  4. Paste the following code:

 

Sub SaveAttachment() Dim objItem As Outlook.MailItem Dim objAtt As Outlook.Attachment Dim saveFolder As String Set objItem = Application.ActiveInspector.CurrentItem saveFolder = "C:\Users\UserName\Documents\" For Each objAtt In objItem.Attachments objAtt.SaveAsFile saveFolder & "\" & objItem.Subject & "." & objAtt.DisplayName Next End Sub

 

  1. Replace "C:\Users\UserName\Documents" with the path of the folder where you want to save the attachment.
  2. Press F5 to run the code.

This code will save all attachments in the email with the subject as the filename and save them in the specified folder. You can modify the code to only save specific attachments or to save them with a different naming convention if needed.

Re: Set filename equal to the subject in an e-mail

The setFileName task is used to set the specified name for a file object. <file_variable>.setFileName(<name>); This will useful for you. Try this once. click anywhere inside the subject line. Once you see a blinking cursor, press CTRL+A to select the entire subject line. Type your new subject. Click the Save icon in the top left corner of the message window, then close the message.

0 Kudos

Re: Set filename equal to the subject in an e-mail

The setFileName task is used to set the specified name for a file object. <file_variable>.setFileName(<name>); This will useful for you. Try this once.   PrepaidGiftBalance

0 Kudos
CathyO-Xerox
Community Manager
Community Manager

Re: Set filename equal to the subject in an e-mail

Hello MKoch,

Are you talking about the scan to email file name? Can you please provide some more details so the community members can better answer your question.

Thanks,
CathyO-Xerox
Community Manager

Be sure to click Kudos for those who have helped you.
Select Accept as Solution for posts that have helped to solve your issue(s)!
0 Kudos
MKoch
New Member
New Member

Set filename equal to the subject in an e-mail

Product Name: AltaLink C8130 / C8135 / C8145 / C8155 / C8170 Color Multifunction Printer
Operating System: Windows 11

Hello,

we would like to set up a Xerox AltaLink C8145 MFP so that the filename is always the same as the subject when an email is sent.

Is this possible? If so, how and where can we set this? Thanks in advance. Kind regards

Martin

0 Kudos