Avatar of Thomas PAIK
Thomas PAIK
 asked on

[VBA / VB.NET] get / set fields in Send to Mail Recipient pane in MS Word

Hi.

How can I get and set the field items in the Send to Mail Recipient pane in MS Word 2010 using VBA or VB.NET?


The field items I would like get and set are:

TO

CC

BCC

Subject

Attachments


FYI, the default mailer application is set to MS Outlook 2010.


Please kindly provide a working VBA or VB.NET code if possible.


['Send to Mail Recipient' in MS Word]



VBAMicrosoft WordVisual Basic.NET

Avatar of undefined
Last Comment
John Korchok

8/22/2022 - Mon
John Korchok

Sorry, but the Send to Mail Recipient command is not part of the VBA object model and cannot be modified in code. You could program using Sendkeys (not especially reliable), or you can create an alternate VBA version that does the same thing. Here's a page where the author has done the heavy lifting for the alternate VBA code: Send Word Document As Email
Thomas PAIK

ASKER
So I guess it is impossible to get/set the above field items without using the Outlook framework.
I anycase, thank you for your feedback.
byundt

Excel MVP Ron de Bruin has a complete set of webpages on using VBA to automate sending emails from Excel. He does it via workbooks containing macros with more "moving parts" than you will likely need. When answering Excel questions needing emails, I start with de Bruin's code, simplify, and adapt to fit the Asker's specified problem.

Although proficient in Excel VBA, I struggle with Word VBA because I am unfamiliar with its object model. I hope you are good enough at Word VBA to bridge the gap.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
ASKER CERTIFIED SOLUTION
John Korchok

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question