![]() |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
![]()
I have Office 365 and that wasn't an option to choose. I am creating a template in Word. I have tried everything I can think of, but I'm not a programmer. All I want to do is have a text box titled "Company" automatically populate based on a dropdown combo content box titled "Contractor", selected value. I think I've tried every option in other threads that I could find. This is the last one and it's not working. I don't know if it makes a difference or not, but the "Company" text box is in the header and the "Contractor" dropdown box is in the main document.
Private Sub Document_ShowTextBasedOnDropdown(ByVal CCtrl As ContentControl, Cancel As Boolean) Dim i As Long, StrDetails As String With CCtrl If .Title = "Company" Then For i = 1 To .DropdownListEntries.Count If .DropdownListEntries(i).Text = .Range.Text Then StrDetails = ActiveDocument.SelectContentControlsByTitle("Contr actor").Item(1).Range.Text Exit For End If End With End If End Sub If I can get this to work, I also have another text box that needs to auto populated based on another text box. So like "Project Name 1" populates "Project Name 2". |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
matthias92701 | Word VBA | 2 | 05-02-2019 03:54 PM |
Copy Formatted Text in one Rich Text Content Control to another Rich Text Content Control | Haygordon | Word | 1 | 04-05-2019 05:43 AM |
![]() |
helenndp | Word VBA | 2 | 09-27-2018 11:04 AM |
Combo Box Content Control Calculate on selection help | ciresuark | Word | 0 | 03-06-2015 01:49 PM |
![]() |
Testor | Word VBA | 4 | 07-08-2012 07:55 AM |