Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-13-2012, 10:33 AM
skusekd skusekd is offline Word 2007 - Drop Box Issue Windows 7 32bit Word 2007 - Drop Box Issue Office 2007
Novice
Word 2007 - Drop Box Issue
 
Join Date: Sep 2012
Posts: 5
skusekd is on a distinguished road
Default Macro


Thank you for the help!

Now I'm having a new issue, probably b/c I've never used macros, and may be getting in a little over my head.

My code seems to be faulty, can you find the error, please? :S

-----------------------------------------------------------------------
Code:
Sub OnExitDDListA()
Dim oDD As DropDown
Dim oFFs As FormFields
Dim StrNew As String
Set oDD = ActiveDocument.FormFields("NAME").DropDown
'Clear previous list
oDD.ListEntries.Clear
'Repopulate list based on user selection
Select Case ActiveDocument.FormFields("TYPE").Result
  Case "Hotels"
    With oDD.ListEntries
      .Add "Best Western Hotel"
      .Add "BonAir Hotel"
      .Add "Econo Lodge"
      .Add "Elect Inn"
      .Add "Glenmore Inn"
      .Add "HoBo Lodge"
      .Add "Holiday Inn"
      .Add "Howard Johnson Inn"
      .Add "Travellers Inn"
      .Add "Other"
    End With
    With ActiveDocument.FormFields("TYPE").DropDown
      If .Value = 10 Then
        StrNew = Trim(InputBox("Input your text", "Free text input"))
        If StrNew = vbNullString Then
          .ListEntries(10).Delete
          .ListEntries.Add StrNew
          .Value = 10
        End If
    End With
  Case "Air Fare"
  Case "Certificates"
    With oDD.ListEntries
      .Add "Aerial Platform"
      .Add "Fall Protection"
      .Add "WHMIS"
      .Add "Other"
    End With
  End Select
lbl_Exit:
Exit Sub
End Sub

Last edited by macropod; 09-13-2012 at 03:29 PM. Reason: Added code tags & formatting
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Word 2007 Cannot Drag and Drop Rbooks Word 7 02-05-2015 11:27 AM
Word 2007 - Drop Box Issue word 2007 - space issue dupefree Word 1 06-27-2012 06:05 AM
Dependent drop down lists in Word 2007 benbenasc Word VBA 0 08-24-2011 06:34 AM
Word 2007 Issue dollsgen Word 1 08-21-2010 09:48 PM
Converting issue 2003 word to 2007(new to 2007 office) lbrown3 Word 0 01-30-2010 07:25 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:23 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