Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub createAbbreviation()
- Dim strFieldTextAbbr As String
- If Selection.Type = wdSelectionIP Then
- Load frmInsertAbbreviation
- Else
- strAbbreviation = Selection.Text
- Load frmInsertAbbreviation
- End If
- frmInsertAbbreviation.Show
- If frmInsertAbbreviation.Tag = "Cancel" Then
- Unload frmInsertAbbreviation
- strAbbreviation = ""
- Exit Sub
- End If
- strFieldTextAbbr = """" & frmInsertAbbreviation.strAbbreviation & """ f Abbreviation t """ & frmInsertAbbreviation.strDefinition & """"
- If Selection.Type = wdSelectionIP Then
- If Selection.Font.Subscript = True Then
- Selection.Font.Subscript = False
- End If
- ActiveDocument.Fields.Add Range:=Selection.Range, Type:=wdFieldIndexEntry, _
- Text:=strFieldTextAbbr
- Else
- Selection.MoveRight Unit:=wdCharacter, Count:=1
- If Selection.Font.Subscript = True Then
- Selection.Font.Subscript = False
- End If
- ActiveDocument.Fields.Add Range:=Selection.Range, Type:=wdFieldIndexEntry, _
- Text:=strFieldTextAbbr
- End If
- Unload frmInsertAbbreviation
- strAbbreviation = ""
- End Sub}
Add Comment
Please, Sign In to add comment