L
Laina Lucas
I have recorded a macro to copy the text in a text field
and add it to the autotext (this way it will autocomplete
when used again). The problem is that when I save the
template and then run it (I have attached it to a field to
run on entry to that field, this is a field that is not
being copied by the macro) I get an error that tells
me "Run-time error '4605': The DisplayAutoCompleteTimps
method or property is not available because the object
referes to a protected area of the document."
How do I make the macro run? I have to have the template
protected and I also need to have the data put in the
autocomplete field.
Here is what the macro looks like:
Sub autofill()
'
' autofill Macro
' Macro recorded 2/1/2004 by Self
'
Application.DisplayAutoCompleteTips = True
Selection.MoveRight Unit:=wdCell
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveLeft Unit:=wdCharacter, Count:=1,
Extend:=wdExtend
Application.DisplayAutoCompleteTips = True
Selection.MoveRight Unit:=wdCell
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveLeft Unit:=wdCharacter, Count:=1,
Extend:=wdExtend
Application.DisplayAutoCompleteTips = True
Selection.MoveRight Unit:=wdCell
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveLeft Unit:=wdCharacter, Count:=1,
Extend:=wdExtend
Application.DisplayAutoCompleteTips = True
Selection.MoveRight Unit:=wdCell
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveLeft Unit:=wdCharacter, Count:=1,
Extend:=wdExtend
Application.DisplayAutoCompleteTips = True
Selection.MoveRight Unit:=wdCell
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveLeft Unit:=wdCharacter, Count:=1,
Extend:=wdExtend
Application.DisplayAutoCompleteTips = True
Selection.MoveRight Unit:=wdCell
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveLeft Unit:=wdCharacter, Count:=1,
Extend:=wdExtend
Application.DisplayAutoCompleteTips = True
Selection.MoveRight Unit:=wdCell
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveLeft Unit:=wdCharacter, Count:=1,
Extend:=wdExtend
Application.DisplayAutoCompleteTips = True
Thanks,
Laina
and add it to the autotext (this way it will autocomplete
when used again). The problem is that when I save the
template and then run it (I have attached it to a field to
run on entry to that field, this is a field that is not
being copied by the macro) I get an error that tells
me "Run-time error '4605': The DisplayAutoCompleteTimps
method or property is not available because the object
referes to a protected area of the document."
How do I make the macro run? I have to have the template
protected and I also need to have the data put in the
autocomplete field.
Here is what the macro looks like:
Sub autofill()
'
' autofill Macro
' Macro recorded 2/1/2004 by Self
'
Application.DisplayAutoCompleteTips = True
Selection.MoveRight Unit:=wdCell
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveLeft Unit:=wdCharacter, Count:=1,
Extend:=wdExtend
Application.DisplayAutoCompleteTips = True
Selection.MoveRight Unit:=wdCell
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveLeft Unit:=wdCharacter, Count:=1,
Extend:=wdExtend
Application.DisplayAutoCompleteTips = True
Selection.MoveRight Unit:=wdCell
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveLeft Unit:=wdCharacter, Count:=1,
Extend:=wdExtend
Application.DisplayAutoCompleteTips = True
Selection.MoveRight Unit:=wdCell
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveLeft Unit:=wdCharacter, Count:=1,
Extend:=wdExtend
Application.DisplayAutoCompleteTips = True
Selection.MoveRight Unit:=wdCell
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveLeft Unit:=wdCharacter, Count:=1,
Extend:=wdExtend
Application.DisplayAutoCompleteTips = True
Selection.MoveRight Unit:=wdCell
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveLeft Unit:=wdCharacter, Count:=1,
Extend:=wdExtend
Application.DisplayAutoCompleteTips = True
Selection.MoveRight Unit:=wdCell
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveLeft Unit:=wdCharacter, Count:=1,
Extend:=wdExtend
Application.DisplayAutoCompleteTips = True
Thanks,
Laina