Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-15-2020, 06:07 PM
ArtKilp ArtKilp is offline How to select the end of a document? Windows 10 How to select the end of a document? Office 2016
Novice
How to select the end of a document?
 
Join Date: Jan 2016
Posts: 18
ArtKilp is on a distinguished road
Default How to select the end of a document?

I have a Word document (.docx), that has "absolutely nothing else" than one contentcontrol. I want to type text after that control. How do I do that? I think I need to move the cursor there, but with what I have tried, for example


Code:
Selection.EndKey Unit:=wdStory
that gets me inside of that contentcontrol i.e. I'm obviously not at the end.
Reply With Quote
  #2  
Old 06-15-2020, 06:17 PM
gmaxey gmaxey is offline How to select the end of a document? Windows 10 How to select the end of a document? Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,428
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim oRng As Range
Set oRng = ActiveDocument.Range
oRng.Collapse wdCollapseEnd
lbl_Exit:
Exit Sub
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
  #3  
Old 06-15-2020, 06:44 PM
ArtKilp ArtKilp is offline How to select the end of a document? Windows 10 How to select the end of a document? Office 2016
Novice
How to select the end of a document?
 
Join Date: Jan 2016
Posts: 18
ArtKilp is on a distinguished road
Default

Quote:
Originally Posted by gmaxey View Post
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim oRng As Range
Set oRng = ActiveDocument.Range
oRng.Collapse wdCollapseEnd
lbl_Exit:
Exit Sub
End Sub
Thanks, that seems to help me accomplish what I needed
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot select my custom tab when new document is opened seamus59 Word VBA 0 03-19-2014 12:21 PM
How to select the end of a document? How to find and select text in a document? mkhuebner Word VBA 8 02-04-2014 08:04 PM
How to select the end of a document? Select statement to a new document ishaw Word 1 10-17-2011 02:23 AM
Unable to select anything in an MS Word Document PaulT Word 0 08-08-2011 07:45 PM
How to select the end of a document? Select printer to document JosL Office 3 03-07-2009 12:40 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:48 PM.


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