Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-08-2017, 12:22 AM
Serpico Serpico is offline Word.Range Windows 10 Word.Range Office 2016
Novice
Word.Range
 
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
  #2  
Old 03-08-2017, 12:50 AM
macropod's Avatar
macropod macropod is offline Word.Range Windows 7 64bit Word.Range Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,514
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by Serpico View Post
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?
You should ask him. It may be just a quirk of his programming style - as is the quite unnecessary use of:
lbl_Exit:
Exit Sub

PS: When posting code, please use the code tags, indicated by the # button on the posting menu. Without them, your code loses much of whatever structure it had.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Distribute text in one cell across a range of cells (overcoming selection.range.cells.count bug) slaycock Word VBA 0 02-18-2017 07:00 AM
Word.Range Find if Date range falls within another range Triadragon Excel 3 05-02-2016 11:48 AM
Word.Range Name a Range in a Word Document and then copy that range to the end of the doc w button click DanNatCorning Word VBA 1 04-29-2016 10:47 PM
Word.Range Set Excel Range using Word gbrew584 Word VBA 3 12-07-2015 01:51 PM
Through VBA, export range from Excel to Word duugg Word VBA 0 08-24-2009 07:50 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:24 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft