D
Dawn
Here is the code I am trying to get work, can anyone help me? My
objective is the following:
to use bookmarks.) It will only take a hand full of cells, merge them,
delete the contents that was already there, and then add a text form
field with 50 characters. This is all to be done in a protected form in
MS Word 2003. I can get bits and pieces working but not the whole
thing as a whole. Please help me. My code is below. FYI: I am a
beginner in the visual basic.
Public Sub DropDown_Click()
With ActiveDocument.FormFields("DropDown1")
Select Case ActiveDocument.FormFields("DropDown1").Result
Case 0
'no selection, do nothing
Case 1
'no selection, do nothing
Case 2
'no selection, do nothing
Case 3
'no selection, do nothing
Case 4
'no selection, do nothing
Case 5
'no selection, do nothing
Case 6
'no selection, do nothing
Case 7
'no selection, do nothing
Case 8
'#8 Blind
Call MacroOne
End Select
End With
End Sub
=================================================
Sub MacroOne()
Selection.GoTo What:=wdGoToBookmark, Name:="LeftSide"
With ActiveDocument.Bookmarks
.DefaultSorting = wdSortByName
.ShowHidden = False
End With
Selection.Cells.Merge
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Range.Cells(1).VerticalAlignment =
wdCellAlignVerticalCenter
Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
Selection.FormFields.Add Range:=Selection.Range, Type:= _
wdFieldFormTextInput
Selection.PreviousField.Select
With Selection.FormFields(1)
.Name = "Text1"
.EntryMacro = ""
.ExitMacro = ""
.Enabled = True
.OwnHelp = False
.HelpText = ""
.OwnStatus = False
.StatusText = ""
With .TextInput
.EditType Type:=wdRegularText, Default:="", Format:=""
.Width = 50
End With
End With
End Sub
objective is the following:
item to run a macro. The macro is taking only part of a table (tryingFrom the nine options in the dropdown box I would like only the last
to use bookmarks.) It will only take a hand full of cells, merge them,
delete the contents that was already there, and then add a text form
field with 50 characters. This is all to be done in a protected form in
MS Word 2003. I can get bits and pieces working but not the whole
thing as a whole. Please help me. My code is below. FYI: I am a
beginner in the visual basic.
Public Sub DropDown_Click()
With ActiveDocument.FormFields("DropDown1")
Select Case ActiveDocument.FormFields("DropDown1").Result
Case 0
'no selection, do nothing
Case 1
'no selection, do nothing
Case 2
'no selection, do nothing
Case 3
'no selection, do nothing
Case 4
'no selection, do nothing
Case 5
'no selection, do nothing
Case 6
'no selection, do nothing
Case 7
'no selection, do nothing
Case 8
'#8 Blind
Call MacroOne
End Select
End With
End Sub
=================================================
Sub MacroOne()
Selection.GoTo What:=wdGoToBookmark, Name:="LeftSide"
With ActiveDocument.Bookmarks
.DefaultSorting = wdSortByName
.ShowHidden = False
End With
Selection.Cells.Merge
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Range.Cells(1).VerticalAlignment =
wdCellAlignVerticalCenter
Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
Selection.FormFields.Add Range:=Selection.Range, Type:= _
wdFieldFormTextInput
Selection.PreviousField.Select
With Selection.FormFields(1)
.Name = "Text1"
.EntryMacro = ""
.ExitMacro = ""
.Enabled = True
.OwnHelp = False
.HelpText = ""
.OwnStatus = False
.StatusText = ""
With .TextInput
.EditType Type:=wdRegularText, Default:="", Format:=""
.Width = 50
End With
End With
End Sub