Prev: CREDIT CARD
Next: Sorting in VBA
From: Graham Mayor on 12 Apr 2010 08:03 The command sequence that Greg posted should work for a legacy text box form field or a legacy dropdown form field called "text". What exactly is in the dropdown selection? What does the following produce in the messagebox? Private Sub CommandButton1_Click() Dim pStr As String pStr = "C:\Users\John\Desktop\" 'Your directory pStr = pStr + ActiveDocument.Formfields("text").Result pStr = pStr + " " pStr = pStr + ActiveDocument.FormFields("ward").Result pStr = pStr + ".doc" MsgBox pStr End Sub -- <>>< ><<> ><<> <>>< ><<> <>>< <>><<> Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org <>>< ><<> ><<> <>>< ><<> <>>< <>><<> "johnnykunst" <user(a)msgroups.net/> wrote in message news:%23RgF3Vi2KHA.4716(a)TK2MSFTNGP06.phx.gbl... > Additionally, could it be that a specific reference in VBA needs to be set > up so that the macro picks up the drop down ebtry? > > --- > frmsrcurl: > http://msgroups.net/microsoft.public.word.vba.general/How-do-I-extract-text-from-drop-down-entry-in-Word-2003
From: Greg Maxey on 12 Apr 2010 08:10 This works find here: pStr = pStr + ActiveDocument.FormFields("text").Result pStr = pStr + " " pStr = pStr + ActiveDocument.FormFields("ward").Result pStr = pStr + " .doc" johnnykunst wrote: > pStr = pStr + ActiveDocument.FormFields("text").Result > > Have tried the above and get the same problem: > > Run-time error 5487: Word cannot complete the save due to a file > permission error. > > This is the same error as with the existing code I was using > Again, if I change the drip down to text it works fine, so it's still > not picking up what's in teh drop down. > > Please note, the Bookmark named text is a text field, the bookmark > named ward is the drop down > > --- > frmsrcurl: > http://msgroups.net/microsoft.public.word.vba.general/How-do-I-extract-text-from-drop-down-entry-in-Word-2003
From: johnnykunst on 12 Apr 2010 09:11
Thank you very, very much, it seems to have worked. Very much appreciated. --- frmsrcurl: http://msgroups.net/microsoft.public.word.vba.general/How-do-I-extract-text-from-drop-down-entry-in-Word-2003 |