Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-03-2017, 12:19 AM
kinimv kinimv is offline Multiple entries in dropdown lists Windows 10 Multiple entries in dropdown lists Office 2016
Novice
 
Join Date: Oct 2017
Location: Seattle, WA
Posts: 9
kinimv is on a distinguished road
Default

Hi Paul, I am new to macros as well, and am looking for a solution to my problem without avail. I tried your zipped file, and understood how it work, but I need something more complex.

My document has a drop down list called 'Test Code.' Drop down options are 1,2,3...10
I want to make it such that whichever option is chosen, fields across the document are automatically filled in based on the option. For illustration, these fields are 'Test Objective', 'Test Conditions', etc. which are not successive fields, but are in different places. How do I implement this?

Thanks
Reply With Quote
  #2  
Old 10-03-2017, 01:24 AM
macropod's Avatar
macropod macropod is offline Multiple entries in dropdown lists Windows 7 64bit Multiple entries in dropdown lists Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,512
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

See post #33: https://www.msofficeforums.com/word-...html#post90264
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 10-08-2017, 06:52 PM
kinimv kinimv is offline Multiple entries in dropdown lists Windows 10 Multiple entries in dropdown lists Office 2016
Novice
 
Join Date: Oct 2017
Location: Seattle, WA
Posts: 9
kinimv is on a distinguished road
Default

Hey Paul,
I looked back to #9 and #19, and didn't quite understand what you were trying to say. I tried messing around with the code based on what I thought was trying to be said, but failed to implement it without getting error codes every time. I have attached my template.

Best,
Vik
Attached Files
File Type: docx Test Report Template Upload.docx (36.7 KB, 39 views)
Reply With Quote
  #4  
Old 10-08-2017, 06:54 PM
macropod's Avatar
macropod macropod is offline Multiple entries in dropdown lists Windows 7 64bit Multiple entries in dropdown lists Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,512
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

Since a docx file can't contain any macros and neither your post nor your document says what you're trying to achieve, I'm not in a position to advise.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 10-08-2017, 07:49 PM
kinimv kinimv is offline Multiple entries in dropdown lists Windows 10 Multiple entries in dropdown lists Office 2016
Novice
 
Join Date: Oct 2017
Location: Seattle, WA
Posts: 9
kinimv is on a distinguished road
Default

Sorry for the confusion. I messed up when removing the sensitive details and uploading. Here, I have attached it again.
What I'm trying to do is that when the Test Number is selected, I want the Description, Reason, and Objective to be filled in. I have filled these in to the values of the drop down list using '|', but I'm not able to have it print separately in different boxes.
Thanks
Attached Files
File Type: docm Test Report Template Upload.docm (43.7 KB, 58 views)
Reply With Quote
  #6  
Old 10-08-2017, 08:35 PM
macropod's Avatar
macropod macropod is offline Multiple entries in dropdown lists Windows 7 64bit Multiple entries in dropdown lists Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,512
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

See attached.

Note: Unless you want spaces either side of your Description, Reason, and Objective outputs, you shouldn't have them in the TestNo control's values.

A generic version of the code is:
Code:
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
Application.ScreenUpdating = False
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 = .DropdownListEntries(i).Value
        Exit For
      End If
    Next
    If StrDetails = "" Then StrDetails = "||"
    With ActiveDocument.SelectContentControlsByTitle("Output1")(1)
      .LockContents = False
      .Range.Text = Split(StrDetails, "|")(0)
      .LockContents = True
    End With
    With ActiveDocument.SelectContentControlsByTitle("Output2")(1)
      .LockContents = False
      .Range.Text = Split(StrDetails, "|")(1)
      .LockContents = True
    End With
    With ActiveDocument.SelectContentControlsByTitle("Output3")(1)
      .LockContents = False
      .Range.Text = Split(StrDetails, "|")(2)
      .LockContents = True
    End With
  End If
End With
Application.ScreenUpdating = True
End Sub
Attached Files
File Type: docm Test Report Template Upload.docm (50.5 KB, 340 views)
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #7  
Old 10-08-2017, 09:36 PM
kinimv kinimv is offline Multiple entries in dropdown lists Windows 10 Multiple entries in dropdown lists Office 2016
Novice
 
Join Date: Oct 2017
Location: Seattle, WA
Posts: 9
kinimv is on a distinguished road
Default

Thanks a lot for your help!
The spaces on the sides were just a holdover from the description I had previously, thanks for pointing it out.
Reply With Quote
  #8  
Old 10-25-2017, 01:02 PM
macropod's Avatar
macropod macropod is offline Multiple entries in dropdown lists Windows 7 64bit Multiple entries in dropdown lists Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,512
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

The ContentControlOnExit macro is missing from your document. If the updates are working correctly on your system without it, that suggests you've added the ContentControlOnExit macro to the document's template on your system instead of to the document itself.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #9  
Old 10-25-2017, 01:32 PM
strodden strodden is offline Multiple entries in dropdown lists Windows 10 Multiple entries in dropdown lists Office 2010 32bit
Novice
 
Join Date: Aug 2017
Posts: 22
strodden is on a distinguished road
Default

Yep - not sure how that happened but it's fixed and working now! Thank you!
Reply With Quote
  #10  
Old 10-25-2017, 05:27 PM
macropod's Avatar
macropod macropod is offline Multiple entries in dropdown lists Windows 7 64bit Multiple entries in dropdown lists Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,512
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

Perhaps it's an updated template you should have been distributing?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #11  
Old 01-23-2018, 12:46 AM
harley harley is offline Multiple entries in dropdown lists Windows 10 Multiple entries in dropdown lists Office 2010 32bit
Novice
 
Join Date: Jan 2018
Posts: 1
harley is on a distinguished road
Default

***Disregard, I see it previously was discussed. Thanks so much***

Dear Paul,

I hope you still check this from time to time. I am curious if I would have to change any of the Macro to get this to work in an existing table? Happy to give more details if you need them.

Thanks
Reply With Quote
  #12  
Old 03-29-2018, 06:21 PM
macropod's Avatar
macropod macropod is offline Multiple entries in dropdown lists Windows 7 64bit Multiple entries in dropdown lists Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,512
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

Did you try the demo in post #2 (https://www.msofficeforums.com/word-...html#post46903). If so, what doesn't that do that you want done?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #13  
Old 03-29-2018, 07:24 PM
Cold in Skagway Cold in Skagway is offline Multiple entries in dropdown lists Windows 7 64bit Multiple entries in dropdown lists Office 2010 64bit
Novice
 
Join Date: Mar 2018
Posts: 3
Cold in Skagway is on a distinguished road
Default

Don't think its the Macro, it's the Operator having the issue, and too many hours trying to resolve it myself. but I have that file saved, going to attempt it again tomorrow after I get some food and sleep and stop stressing over it.
Reply With Quote
  #14  
Old 03-29-2018, 08:14 PM
macropod's Avatar
macropod macropod is offline Multiple entries in dropdown lists Windows 7 64bit Multiple entries in dropdown lists Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,512
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

Cross-posted at: https://answers.microsoft.com/en-us/...b-6b6db6bc9336
For cross-posting etiquette, please read: http://www.excelguru.ca/content.php?184
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #15  
Old 03-31-2018, 02:04 PM
Cold in Skagway Cold in Skagway is offline Multiple entries in dropdown lists Windows 7 64bit Multiple entries in dropdown lists Office 2010 64bit
Novice
 
Join Date: Mar 2018
Posts: 3
Cold in Skagway is on a distinguished road
Default

Well I still don't understand how to get this to work.
I guess I am a "lead me by the hand" type of person.
Not thick or stupid, I just don't understand the "why" or "how" part I guess, or even the basics of it all.

Let me ask you this question.
If I did succeed it getting this to work, I would have to save it as a ".doxm" correct?
Would the person(s) wanting to use this form also have to have the macro installed and have to run it every time they fill in the info, or would it be automatic?

Please understand, the less clicks and fiddling around to get the form filled out and printed with the info the better.

Thanks again for the help.
Beth
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple entries in dropdown lists Delete Multiple Entries dudeabides Office 1 07-04-2011 02:49 AM
Multiple task lists and multiple calendars kballing Outlook 0 01-18-2011 10:23 AM
Creating Multiple Contact Lists meltee78 Outlook 1 01-03-2011 09:45 PM
multiple calendar entries across a group halfhearted Outlook 0 10-11-2009 12:13 PM
Word Forms : Dropdown lists wferaera45 Word 0 04-06-2006 03:02 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:33 AM.


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