Passing Attachments between forms?

Status
Not open for further replies.

nubsauce

New Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server 2010
Hi Everyone,

I'm new to developing outlook forms but not new to VBA (excel and some word).

I'm still trying to get a handle on all the different types of classifications of outlook and have been able to find the help I need to develop a custom form etc.

Everything seems to be working well but one feature I can't seem to locate info on is how to (if its even possible) to automatically pass attachments to a new form when clicking reply.

Right now I have Form1 and Form2 setup in a very simple manner so that when the user clicks reply in Form1, it opens up Form2 and passes all the field values to the form. My challenge is in passing the attachments as well...

Based on regular outlook functions, if the user clicks Forward, the attachments and info goes with it, but not the sender, cc, and bcc info. If the user clicks Reply, all the sender, cc, and bcc info is passed on but not the attachments.

Is there a way for me to pass on the attachments as well on reply?

Thanks for the help.

Between this forum and outlookcode.com I've been able to get started in this new world of Outlook forms... :)
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
As far as I know, you need to use a script - it will save the attachments then add them to the new form.

This is the vba code - you'd want to use script in the form so it will need to be tweaked.

CopyAttachments form1, form2

Code:
Sub CopyAttachments(objSourceItem, objTargetItem)
   Set fso = CreateObject("Scripting.FileSystemObject")
   Set fldTemp = fso.GetSpecialFolder(2) ' TemporaryFolder
   strPath = fldTemp.Path & "\"
   For Each objAtt In objSourceItem.Attachments
      strFile = strPath & objAtt.FileName
      objAtt.SaveAsFile strFile
      objTargetItem.Attachments.Add strFile, , , objAtt.DisplayName
      fso.DeleteFile strFile
   Next
 
   Set fldTemp = Nothing
   Set fso = Nothing
End Sub
 

nubsauce

New Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server 2010
Thanks Diane, definitely appreciate the help!

I'll start playing around with it and update if I can get it to work.

Thanks again,
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
K Passing a form field as a parameter from Outlook Using Outlook 12
K TextBox on Custom Form Page :: Passing value from sender to the recipient Outlook VBA and Custom Forms 1
B Passing values from custom form into another form's text box Outlook VBA and Custom Forms 1
P Print attachments automatically and move the mail to an existing folder called "Ted" Outlook VBA and Custom Forms 5
G Schedule recurring email and attachments display Outlook VBA and Custom Forms 3
G Save and Rename Outlook Email Attachments Outlook VBA and Custom Forms 0
L Macro/VBA to Reply All, with the original attachments Outlook VBA and Custom Forms 3
A Attachments.Delete Outlook VBA and Custom Forms 3
M Deleting attachments does not reduce file size Using Outlook 0
L unblocking attachments before sending Office 365 Advanced Protection Using Outlook 0
I Saving attachments from multiple emails and updating file name Outlook VBA and Custom Forms 0
R Use an ItemAdd to Save Attachments on Arrival Outlook VBA and Custom Forms 0
shrydvd vba to secure zip attachments Outlook VBA and Custom Forms 3
R fetching blocked attachments Outlook VBA and Custom Forms 0
H Outlook 2016 sent over 30 copies of an e-mail with attachments Using Outlook 1
W Automatically open attachments without automatically printing them Using Outlook 0
O Save attachments using hotkey without changing attributes Outlook VBA and Custom Forms 1
T Outlook converts sent email to txt attachments when sync Using Outlook 0
Nadine Rule to move attachments with specific name Outlook VBA and Custom Forms 1
R Outlook is NOT removing attachments. Using Outlook 4
Dan_W Nested email attachments Outlook VBA and Custom Forms 4
M Print email and, attachments sent in hyperlinks in the email Outlook VBA and Custom Forms 2
W Save and rename outlook email attachments to include domain name & date received Outlook VBA and Custom Forms 4
S DRAGGING MAIL AND ATTACHMENTS TO CALENDAR Using Outlook 1
D Print attachments automatically and moves the mail to a new folder Outlook VBA and Custom Forms 9
G Download pdf attachments only if email subject has one of words Outlook VBA and Custom Forms 8
D Saving Selected Emails as PDF and saving Attachments Outlook VBA and Custom Forms 6
R Quick Access view in File Explorer when saving attachments Using Outlook 0
J Save E-mail attachments in a specific folder Outlook VBA and Custom Forms 0
O Wishlist Native solution to detach attachments but keep a link to them Outlook Wishlist 1
broadbander Needing help with reply/reply all while keeping attachments and adding a new CC recipient. Outlook VBA and Custom Forms 5
I Forwarding attachments in email received Outlook VBA and Custom Forms 3
A Outlook - Send New 20 Attachments through Email Using Outlook 4
D Print Attachments only in selected emails using a macro Outlook VBA and Custom Forms 3
M Outlook 2016 msg attachments Using Outlook 0
N Saving And Deleting Outlook Attachments with Unknown Error Message Outlook VBA and Custom Forms 1
M Macro for attachments download adjustment Outlook VBA and Custom Forms 3
M VBA macro for Inbox's attachments search Outlook VBA and Custom Forms 0
C Auto save outlook attachments when email is received Outlook VBA and Custom Forms 1
S Outlook 2010 Cannot Open Attachments Using Outlook 14
I Print Automatically Attachments Outlook VBA and Custom Forms 3
Diane Poremsky Save Messages and Attachments to a New Folder Using Outlook 0
B Delete/replace old files and save new attachments Using Outlook 1
J Saving attachments from specific sender (phone number) to specific folder on hard drive Using Outlook 3
Diane Poremsky Disable Protected View for Outlook Attachments Using Outlook 0
C Saving Outlook attachments and links to attachments with VBA Outlook VBA and Custom Forms 2
Diane Poremsky Remove Attachments From Messages Using Outlook 0
Diane Poremsky Outlook is sending winmail.dat attachments Using Outlook 0
Diane Poremsky Edit and Save Outlook's Read-Only Attachments Using Outlook 0
J Forward Message after editing attachments and include edited attachments Using Outlook 5

Similar threads

Top