D
Dorak
We use Word 2003XP
Message: "This feature is disabled because it is not compatible with
Microsoft Word 97"
On certain machines, debug produces issue at following code:
Selection.PasteAndFormat (wdPasteDefault)
An AutoNew macro displays user form to collect data.
Complete code not including the AutoNew macro is below:
Private Sub CommandButton1_Click()
End Sub
Private Sub CancelBtn_Click()
Dim intResponse As Integer
intResponse = MsgBox("Are you sure you want to quit?", _
vbYesNo + vbQuestion, "Quit")
If intResponse = vbYes Then
NewMatter2.Hide
Unload NewMatter2
Else
Exit Sub
End If
End Sub
Private Sub OKBtn_Click()
With ActiveDocument
Selection.GoTo What:=wdGoToField, Which:=wdGoToNext, Count:=1, Name:= _
"MACROBUTTON"
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
End With
If TextBox1 = "" Then
MsgBox ("All fields must be completed!")
Exit Sub
End If
If TextBox2 = "" Then
MsgBox ("All fields must be completed!")
Exit Sub
End If
If TextBox3 = "" Then
MsgBox ("All fields must be completed!")
Exit Sub
End If
If TextBox4 = "" Then
MsgBox ("All fields must be completed!")
Exit Sub
End If
If TextBox5 = "" Then
MsgBox ("All fields must be completed!")
Exit Sub
End If
If TextBox6 = "" Then
MsgBox ("All fields must be completed!")
Exit Sub
End If
If TextBox7 = "" Then
MsgBox ("All fields must be completed!")
Exit Sub
End If
If cboPgroup = "" Then
MsgBox ("You Must Choose a Practice Group")
Exit Sub
End If
With ActiveDocument
.Bookmarks("FileNo").Range.Text = TextBox1.Value
.Bookmarks("Client").Range.Text = TextBox2.Value
.Bookmarks("Matter").Range.Text = TextBox3.Value
.Bookmarks("DateOpened").Range.Text = TextBox4.Value
.Bookmarks("OriginatingAttorney").Range.Text = TextBox5.Value
.Bookmarks("BillingAttorney").Range.Text = TextBox6.Value
.Bookmarks("ResponsibleAttorney").Range.Text = TextBox7.Value
.Bookmarks("PracticeGroup").Range.Text = cboPgroup.Value
End With
Selection.Tables(1).Select
Selection.Copy
Selection.GoTo What:=wdGoToBookmark, Name:="Folder2Paste"
Selection.PasteAndFormat (wdPasteDefault)
Selection.GoTo What:=wdGoToBookmark, Name:="Folder3Paste"
Selection.PasteAndFormat (wdPasteDefault)
Selection.GoTo What:=wdGoToBookmark, Name:="Folder4Paste"
Selection.PasteAndFormat (wdPasteDefault)
Selection.GoTo What:=wdGoToBookmark, Name:="Folder5Paste"
Selection.PasteAndFormat (wdPasteDefault)
NewMatter2.Hide
Unload NewMatter2
End Sub
Private Sub UserForm_Initialize()
With cboPgroup
.AddItem "B"
.AddItem "BT"
.AddItem "CCL"
.AddItem "EEDR"
.AddItem "IP"
.AddItem "MM"
.AddItem "PI"
.AddItem "RE"
.AddItem "TWE"
End With
End Sub
Message: "This feature is disabled because it is not compatible with
Microsoft Word 97"
On certain machines, debug produces issue at following code:
Selection.PasteAndFormat (wdPasteDefault)
An AutoNew macro displays user form to collect data.
Complete code not including the AutoNew macro is below:
Private Sub CommandButton1_Click()
End Sub
Private Sub CancelBtn_Click()
Dim intResponse As Integer
intResponse = MsgBox("Are you sure you want to quit?", _
vbYesNo + vbQuestion, "Quit")
If intResponse = vbYes Then
NewMatter2.Hide
Unload NewMatter2
Else
Exit Sub
End If
End Sub
Private Sub OKBtn_Click()
With ActiveDocument
Selection.GoTo What:=wdGoToField, Which:=wdGoToNext, Count:=1, Name:= _
"MACROBUTTON"
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
End With
If TextBox1 = "" Then
MsgBox ("All fields must be completed!")
Exit Sub
End If
If TextBox2 = "" Then
MsgBox ("All fields must be completed!")
Exit Sub
End If
If TextBox3 = "" Then
MsgBox ("All fields must be completed!")
Exit Sub
End If
If TextBox4 = "" Then
MsgBox ("All fields must be completed!")
Exit Sub
End If
If TextBox5 = "" Then
MsgBox ("All fields must be completed!")
Exit Sub
End If
If TextBox6 = "" Then
MsgBox ("All fields must be completed!")
Exit Sub
End If
If TextBox7 = "" Then
MsgBox ("All fields must be completed!")
Exit Sub
End If
If cboPgroup = "" Then
MsgBox ("You Must Choose a Practice Group")
Exit Sub
End If
With ActiveDocument
.Bookmarks("FileNo").Range.Text = TextBox1.Value
.Bookmarks("Client").Range.Text = TextBox2.Value
.Bookmarks("Matter").Range.Text = TextBox3.Value
.Bookmarks("DateOpened").Range.Text = TextBox4.Value
.Bookmarks("OriginatingAttorney").Range.Text = TextBox5.Value
.Bookmarks("BillingAttorney").Range.Text = TextBox6.Value
.Bookmarks("ResponsibleAttorney").Range.Text = TextBox7.Value
.Bookmarks("PracticeGroup").Range.Text = cboPgroup.Value
End With
Selection.Tables(1).Select
Selection.Copy
Selection.GoTo What:=wdGoToBookmark, Name:="Folder2Paste"
Selection.PasteAndFormat (wdPasteDefault)
Selection.GoTo What:=wdGoToBookmark, Name:="Folder3Paste"
Selection.PasteAndFormat (wdPasteDefault)
Selection.GoTo What:=wdGoToBookmark, Name:="Folder4Paste"
Selection.PasteAndFormat (wdPasteDefault)
Selection.GoTo What:=wdGoToBookmark, Name:="Folder5Paste"
Selection.PasteAndFormat (wdPasteDefault)
NewMatter2.Hide
Unload NewMatter2
End Sub
Private Sub UserForm_Initialize()
With cboPgroup
.AddItem "B"
.AddItem "BT"
.AddItem "CCL"
.AddItem "EEDR"
.AddItem "IP"
.AddItem "MM"
.AddItem "PI"
.AddItem "RE"
.AddItem "TWE"
End With
End Sub