View Single Post
 
Old 07-06-2020, 04:12 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,977
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

For your first question, try
.Subject = "WO: RFW " & ActiveDocument.SelectContentControlsByTag("System" )(1).Range.Text

For the attachments, I would assume there are two ways to approach this:
1. Actually embed the attachments into the Word doc and then work out how to extract them for the email
2. Create a list of filepaths and then have the email attachments built from these filepath strings.

Personally, I would expect the second method to be easier to code and less error prone.

The browse function is not something you would find as a native function in the Content Controls but it could be coded and executed either by entering a Content Control or maybe by a button on the ribbon. The code to select a file is often called FilePicker and there are plenty of samples showing how you use it. You could start here FileDialog object (Office) | Microsoft Docs or do a search for other examples.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote