Método AutoTextEntries. AppendToSpike (Word)AutoTextEntries.AppendToSpike method (Word)
Exclui o intervalo especificado e adiciona o conteúdo do intervalo ao AutoTexto especial (uma entrada de AutoTexto interna).Deletes the specified range and adds the contents of the range to the Spike (a built-in AutoText entry). Esse método retorna o pico como um objeto AutoTextEntry .This method returns the Spike as an AutoTextEntry object.
SintaxeSyntax
expression.expression. AppendToSpike
( _Range_
)AppendToSpike
( _Range_
)
expressão Obrigatório.expression Required. Uma variável que representa uma coleção 'AutoTextEntries'.A variable that represents an 'AutoTextEntries' collection.
ParâmetrosParameters
NomeName | Obrigatório/OpcionalRequired/Optional | Tipo de dadosData type | DescriçãoDescription |
---|---|---|---|
RangeRange | ObrigatórioRequired | RangeRange | O intervalo que é excluído e adicionado ao AutoTexto especial.The range that's deleted and appended to the Spike. |
Valor de retornoReturn value
AutoTextEntryAutoTextEntry
ComentáriosRemarks
O método AppendToSpike só é válido para a coleção AutoTextEntries no modelo Normal.The AppendToSpike method is only valid for the AutoTextEntries collection in the Normal template.
ExemploExample
Este exemplo exclui a seleção e adiciona seu conteúdo ao AutoTexto especial no modelo Normal.This example deletes the selection and adds its contents to the Spike in the Normal template.
If Len(Selection.Range.Text) > 1 Then
NormalTemplate.AutoTextEntries.AppendToSpike _
Range:=Selection.Range
End If
Este exemplo limpa o AutoTexto especial e adiciona a primeira e a terceira palavras do documento ativo ao AutoTexto especial no modelo Normal.This example clears the Spike and adds the first and third words in the active document to the Spike in the Normal template. Em seguida, o conteúdo do AutoTexto especial é inserido no ponto de inserção.The contents of the Spike are then inserted at the insertion point.
Dim atEntry As AutoTextEntry
Selection.Collapse Direction:=wdCollapseStart
For Each atEntry In NormalTemplate.AutoTextEntries
If atEntry.Name = "Spike" Then atEntry.Delete
Next atEntry
With NormalTemplate.AutoTextEntries
.AppendToSpike Range:=ActiveDocument.Words(3)
.AppendToSpike Range:=ActiveDocument.Words(1)
.Item("Spike").Insert Where:=Selection.Range
End With
Confira tambémSee also
Objeto da coleção AutoTextEntriesAutoTextEntries Collection Object
Suporte e comentáriosSupport and feedback
Tem dúvidas ou quer enviar comentários sobre o VBA para Office ou sobre esta documentação?Have questions or feedback about Office VBA or this documentation? Confira Suporte e comentários sobre o VBA para Office a fim de obter orientação sobre as maneiras pelas quais você pode receber suporte e fornecer comentários.Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.