Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-05-2014, 09:45 PM
lucky16 lucky16 is offline More than one content controls in a word document Windows 7 32bit More than one content controls in a word document Office 2007
Novice
More than one content controls in a word document
 
Join Date: Jan 2014
Posts: 21
lucky16 is on a distinguished road
Post More than one content controls in a word document

Hello experts,

I have a situation in word document, where two content controls are to be placed, one to right and other to the left of a document.

I recently learned, inserting one content control in a document, but this seems to be more difficult. Can you please help me out.



Attached is the word document, in which content controls are placed.

Thank you.
Attached Files
File Type: docx Content Controls.docx (31.5 KB, 13 views)
Reply With Quote
  #2  
Old 07-05-2014, 11:22 PM
macropod's Avatar
macropod macropod is offline More than one content controls in a word document Windows 7 32bit More than one content controls in a word document Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

What particular problem are you having? Inserting one content control adjacent to another is conceptually the same as inserting any other two objects beside each other.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 07-06-2014, 10:13 AM
lucky16 lucky16 is offline More than one content controls in a word document Windows 7 32bit More than one content controls in a word document Office 2007
Novice
More than one content controls in a word document
 
Join Date: Jan 2014
Posts: 21
lucky16 is on a distinguished road
Default

These are content control depended dropdowns. When an item from the content control dropdown is selected, dependent text is inseretd in the next line. Following is the code i am using.

Quote:
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
Dim i As Long, StrDetails As String
With ContentControl
If .Title = "Client" Then
For i = 1 To .DropdownListEntries.Count
If .DropdownListEntries(i).Text = .Range.Text Then
StrDetails = Replace(.DropdownListEntries(i).Value, "|", Chr(11))
Exit For
End If
Next
ActiveDocument.ContentControls(2).Range.Text = StrDetails
End If
End With

With ContentControl
If .Title = "Delivery contacts" Then
For i = 1 To .DropdownListEntries.Count
If .DropdownListEntries(i).Text = .Range.Text Then
StrDetails = Replace(.DropdownListEntries(i).Value, "|", Chr(11))
Exit For
End If
Next
ActiveDocument.ContentControls(3).Range.Text = StrDetails
End If
End With
End Sub
Trying to have these dependent dropdowns side by side.

Thank you.
Reply With Quote
  #4  
Old 07-06-2014, 04:14 PM
macropod's Avatar
macropod macropod is offline More than one content controls in a word document Windows 7 32bit More than one content controls in a word document Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Having the content controls side by side has nothing to do with the code (which is merely an adaptation of some I wrote, BTW). It's simply a matter of placement of the objects in the document. For example, if you create a two-column table, you could put one content control in one column and the other content control in the adjacent column. Indeed, you don't even need a table - you could separate them with something as simple as a tab or a space character.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 07-09-2014, 08:36 AM
lucky16 lucky16 is offline More than one content controls in a word document Windows 7 32bit More than one content controls in a word document Office 2007
Novice
More than one content controls in a word document
 
Join Date: Jan 2014
Posts: 21
lucky16 is on a distinguished road
Default

Hi paul,
I was really poor in framing my question, may be due to lack of knowledge.
In one of your examples of contentcontols, where selecting an item from dropdown returns the email id, fax no, etc of selected item. I'm trying to have the same thing, on both sides of the document.

So that when i select my customer name from the dropdown on left, it returns the phone and fax no.
similarly when I select my dealer name from dropdown on right, returns the phone and fax of dealer.

Thank you very much for taking time on this.
Reply With Quote
  #6  
Old 07-09-2014, 04:34 PM
macropod's Avatar
macropod macropod is offline More than one content controls in a word document Windows 7 32bit More than one content controls in a word document Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

My previous post told you how to do that...
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #7  
Old 07-10-2014, 08:34 AM
lucky16 lucky16 is offline More than one content controls in a word document Windows 7 32bit More than one content controls in a word document Office 2007
Novice
More than one content controls in a word document
 
Join Date: Jan 2014
Posts: 21
lucky16 is on a distinguished road
Default

Anyways. THANK YOU very much.
Reply With Quote
Reply

Tags
vba in microsoft word, vba word



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to use onchange event for content controls in word lucky16 Word VBA 7 06-06-2014 05:05 AM
More than one content controls in a word document MS Word 2010 Content Controls and PDF Conversion. MaxInCO Word 3 02-13-2014 12:58 PM
Word 2010 Macro Enabled Template with Content Controls keen1598 Word VBA 7 01-29-2014 03:17 PM
Disabling content controls and protecting document sections. Catty Word VBA 2 11-29-2013 05:10 AM
Using both rich and plain content controls in one document Erica.Black Word 0 06-18-2013 10:33 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:51 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft