Thread: [Solved] Word.Range
View Single Post
 
Old 03-08-2017, 12:22 AM
Serpico Serpico is offline Windows 10 Office 2016
Novice
 
Join Date: Mar 2017
Posts: 4
Serpico is on a distinguished road
Default

Hello macropod,

Thank you for you reply.
If I understand you right, the prefix of the variable type range (in this case), is only to specify the application your running from (word.range -> word app)? Ok, that sounds clear for me. But look below on the example (it is from Gerg Maxey):
Why does he refer to the word app? His code is to be used anyhow in VBA Word?

Code:
Sub InsertInBookmarkIII()
Dim oRng As Word.Range
   Set oRng = ActiveDocument.Bookmarks("bmInBookmark").Range
   oRng.Text = InputBox("What is your favorite color?")
   ActiveDocument.Bookmarks.Add "bmInBookmark", oRng 
lbl_Exit:
   Exit Sub
End Sub
Thank you

Last edited by macropod; 03-08-2017 at 12:47 AM. Reason: Added code tags & formatting
Reply With Quote