Copy "To" Address Value from a Newly Created Email to the "To" Address Field of Custom Form

Status
Not open for further replies.

Michael Miller

New Member
Outlook version
Outlook 2010 32 bit
Email Account
IMAP
Thanks for all of the valuable info. It was essential in creating my custom form & works great. However, the person wanting the form would rather not have an email address simply copied and pasted into the Recipients field by users. They would like the form to auto populate with the email address ready to go.

My workaround would be:

In the example: clicking a "mailto:" link in an HTML doc opens a blank email in outlook with the to address pre filled. In the quick access toolbar of that email, I have a button for the macro that launches the custom form.

I basically need to copy the "To" field value from the first email (generated by clicking that html doc link) to my custom form on open, then close that first email. (Essentially replacing the first "mailto:" generated email with my custom form) I'm at a loss, though, as to how to talk to that first email from my form.
 
Where is the address coming from? You might be able to grad it using a macro. If not, you can grab it from the other message. You need to identify the message that is in focus, get the item.to entry and insert it in the custom form. But I'd try to grab the address without opening the extra message.
 
Thanks again. The address is coming from other software that doesn't interface with Outlook, a (ie. button or a link on a web page). Unfortunately the extra message has to be opened in order to utilize the form, in this case. Since I'll be putting my "launch form" macro in the "Quick Access" menu bar, is it possible to include that "item.to grab" as part of the open macro and trasfer it from there. Grabbing it from "the other" message is where I'm having the problem, I don't have the slightest clue as how to access it since it's no longer in focus and the "To:" value is not stored anywhere else.
 
You can use the title bar to bring the message into focus. Or, after the message is open, run the macro and call up the template. That would actually be easier.
 
Thanks so much again for pointing me in the right direction. I'm sharing the code that I ended up using (snippets from here, there, and everywhere in this forum) in case anyone else needs a hand. (The following goes in the Macro from opening a custom form).

Public Sub ComplexCustomForm()
Dim olfolder As Outlook.MAPIFolder
Dim olapp As Outlook.Application
Dim Items As Outlook.Items
Dim Item As Object
Dim m As mailItem
Set m = ActiveInspector.CurrentItem
f = m.To
Set olapp = CreateObject("Outlook.Application")
Set olfolder = olapp.GetNamespace("Mapi").folders("SHARED FOLDER WHERE IPM.Note RESIDES")
Set Items = olfolder.Items
Set Item = Items.Add("IPM.Note.ComplexCustomForm")
Item.Display
Item.To = f
m.Close olDiscard
Set m = Nothing
Set olfolder = Nothing
Set olapp = Nothing
Set Items = Nothing
Set Item = Nothing
End Sub
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
R Copy/paste mailing address Outlook 2013 Using Outlook 6
L Outlook 2007 Copy Email Address in To Field Using Outlook 11
P Copy email address from outlook 2013/2010 Using Outlook 1
R Macro to copy email address Using Outlook 6
icacream I just need to copy my address book to my new laptop ! Using Outlook 18
R how to copy a list of email contacts and paste them only as names (not names + email address) Using Outlook 12
S Using copy paste to grab email addresses from the TO: address fiel Using Outlook 14
C Copy from one Profile to another Using Outlook 0
M "Attachment Detacher for Outlook" add in, does it update the server copy of the email? Using Outlook 1
C Outlook 365 Copy/Save Emails in Folder Outside Outlook to Show Date Sender Recipient Subject in Header Using Outlook 0
D Copy Appointment Body to Task Body Outlook VBA and Custom Forms 0
M copy field value to custom field Outlook VBA and Custom Forms 0
O In Agenda-view - How to copy an existing item months ahead or back? Using Outlook 0
C Move or copy from field to field Outlook VBA and Custom Forms 0
Z Copy specific email body text Outlook VBA and Custom Forms 0
B Need to Copy an email to a subfolder Outlook VBA and Custom Forms 2
O Outlook 365 - How to create / copy a new contact from an existing one? Using Outlook 5
S Copy Tasks/Reminders from Shared Mailbox to Personal Tasks/Reminders Outlook VBA and Custom Forms 0
A Cannot copy this folder because it may contain private items Using Outlook 0
C Copy Move item won't work Outlook VBA and Custom Forms 2
Z VBA to convert email to task, insert text of email in task notes, and attach copy of original email Outlook VBA and Custom Forms 4
Commodore Move turns into "copy" Using Outlook 3
C Copy Outlook contact field value to another field Outlook VBA and Custom Forms 1
J Copy to calendar function no longer working in outlook 365 Using Outlook 5
F Copy and replace not update contact in another pst Using Outlook 0
B Outlook Business Contact Manager with SQL to Excel, User Defined Fields in BCM don't sync in SQL. Can I use VBA code to copy 1 field to another? BCM (Business Contact Manager) 0
Commodore Folders always closed in move/copy items dialog box Using Outlook 3
N Outlook rules don't create a copy for bcc'ed emails Using Outlook 3
geofferyh Outlook 2010 How to Copy Outlook Attachment to a Specific Folder? Outlook VBA and Custom Forms 3
S Custom Form, copy user field data to message body Outlook VBA and Custom Forms 12
R Copy Outlook Public Folders to a File Server Shared Folder Using Outlook 0
K Outlook Rules: Move a Copy Using Outlook 4
oliv- HOW TO COPY /USE FOLDERS ICONS Outlook VBA and Custom Forms 2
E Copy e-mail body from outlook and insert into excel Outlook VBA and Custom Forms 3
B Copy/Move Exchange inbox to Pop inbox Using Outlook 4
R Sending email copy (*.msg file) of sent email if subject line contains specific string. Outlook VBA and Custom Forms 1
O Copy mails from many subfolders to 1 foldr Using Outlook 2
K ind specific Subject line from outlook and copy the content of the email body to exce Outlook VBA and Custom Forms 0
K How to find specific header and copy the mail body Using Outlook 0
J Copy or Export Outlook Mail to Excel Outlook VBA and Custom Forms 6
G Copy Contact field to Appointment Custom Form Field Outlook VBA and Custom Forms 2
G How to Copy Multi Select Listbox Data to Appointment Outlook VBA and Custom Forms 3
Carrie Dickey Outlook 2016 created two calendars titled Calendar1 - appear to be a copy Using Outlook 2
P How to copy and append data from Outlook 2016 message into Excel 2016 workbook Using Outlook 0
Stilgar Relsik Create a rule to copy text from an email and paste it in the subject line. Using Outlook 1
R Macro to copy email to excel - Runtime Error 91 Object Variable Not Set Outlook VBA and Custom Forms 11
H Macro to Copy Specific content from Mail Body and Paste to Excel Outlook VBA and Custom Forms 4
M How to keep reccurence during copy tasks to calendar? Using Outlook 1
Diane Poremsky Copy New Appointments to Another Calendar using VBA Using Outlook 0
Diane Poremsky Use a macro to copy data in Outlook email to Excel workbook Using Outlook 0

Similar threads

Back
Top