G
Greg
Can someone explain why test1 generates a run-time error 4605
but if I change myRng to Selection.Range in test2 and put the cursor in
Row 1 Column 1 of the first table it works fine? Thanks.
Sub Test1()
Dim myRng As Range
Set myRng = ActiveDocument.Tables(1).Cell(1, 1).Range
ActiveDocument.Fields.Add Range:=myRng, _
Type:=wdFieldIncludeText, Text:="""c:\\Job 1.doc"""
End Sub
Sub Test2()
ActiveDocument.Fields.Add Range:=Selection.Range, _
Type:=wdFieldIncludeText, Text:="""c:\\Job 1.doc"""
End Sub
but if I change myRng to Selection.Range in test2 and put the cursor in
Row 1 Column 1 of the first table it works fine? Thanks.
Sub Test1()
Dim myRng As Range
Set myRng = ActiveDocument.Tables(1).Cell(1, 1).Range
ActiveDocument.Fields.Add Range:=myRng, _
Type:=wdFieldIncludeText, Text:="""c:\\Job 1.doc"""
End Sub
Sub Test2()
ActiveDocument.Fields.Add Range:=Selection.Range, _
Type:=wdFieldIncludeText, Text:="""c:\\Job 1.doc"""
End Sub