Word 문서에서 텍스트를 선택한 다음 Kutools 탭 아래의 북마크 삽입 아이콘을 클릭할 때 공백이 자동으로 밑줄로 바뀌지 않는 특별한 이유가 있습니까? 이는 Kutools가 즉시 구현할 수 있고 구현해야 하는 완전히 논리적이고 시간을 절약해 주는 기능처럼 보입니다. 나는 소프트웨어를 구입할 때 그러한 기능을 기대했을 것이며 이에 대한 다른 사람의 의견 및/또는 생각을 환영합니다.
Sub InsertNewBookmark()
Dim MyData As DataObject
Dim strClip As String
Dim bkName As String
If Selection.Type = wdSelectionNormal Then
Selection.Copy
End If
Set MyData = New DataObject
MyData.GetFromClipboard
strClip = MyData.GetText
strClip = Trim(strClip)
strClip = Replace(strClip, " ", " ")
strClip = Replace(strClip, " ", " ")
strClip = Replace(strClip, " ", "_")
bkName = InputBox("Insert new bookmark name.", "Hello there.", strClip)
On Error GoTo Oops
If (StrPtr(bkName) = 0) Then
' MsgBox "You pressed cancel or [X]."
Exit Sub
ElseIf (bkName = "") Then
MsgBox "You have to name the bookmark. Try again."
Call InsertNewBookmark
Else
ActiveDocument.Bookmarks.Add _
Name:=bkName, Range:=Selection.Range
Exit Sub
End If
Oops:
MsgBox ("The bookmark could not be created. Remember to follow these guidelines :" & vbNewLine & vbNewLine & "• Names must begin with a letter of the alphabet." _
& vbNewLine & "• Names can contain only letters, numbers, and the underscore." & vbNewLine & "• Names cannot contain spaces or punctuation marks." & vbNewLine _
& vbNewLine & "Let's try it again. Ready?")
Call InsertNewBookmark
End Sub