PDA

View Full Version : VBA to Save file based on Content Controls



Tang
07-19-2013, 05:13 PM
I am writing a Macro that saves my Word document to a specific location based upon the value in a Content Control Dropdown (Manager) and Content Control DatePicker (Date).

Here is the Code I have so far:

ActiveDocument.SaveAs "\\cssshare01.nwie.net\itsd\Specialists\Chat Review\" & _
ActiveDocument.ContentControlListEntry("Manager").Text & "\" & ActiveDocument.ContentControlsListEntry("Date").Text & ".docx"

I do have the dropdown tags named appropriately, but I'm not sure if "ContentControlListEntry" should be used.

I have searched the internet and consulted friends with no luck. Hopefully You can assist.

Thanks in advance

gmaxey
07-21-2013, 02:34 PM
You'll need something like this:ActiveDocument.SelectContentControlsByTitle("Manager").Item(1).Range.Text

Tang
07-24-2013, 04:21 PM
That was exactly what I was looking for. Thank you so much!