Selecting a Word location from Excel
Hi,
I'd like to write a macro that opens a dialogue box in Word, which asks the user to choose a location in the document by clicking it, and for the code to either return the location of that selection, or just paste a bookmark to that location (and ask the user to name that bookmark).
I know that a similar thing can be done in Excel. Here is an example of an Excel macro that asks the user to select some cells in Excel, and then bold them:
Sub RangeDataType()
Dim rRange As Range
On Error Resume Next
Application.DisplayAlerts = False
Set rRange = Application.InputBox(Prompt:= _
"Please select a range with your Mouse to be bolded.", _
Title:="SPECIFY RANGE", Type:=8)
On Error GoTo 0
Application.DisplayAlerts = True
If rRange Is Nothing Then
Exit Sub
Else
rRange.Font.Bold = True
End If
End Sub
Unfortunately, Word's InputBox command doesn't seem to allow you to choose your range from Word. Is there another way of doing it?
Thanks,
Durand
|