Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 08-19-2014, 05:11 AM
Smallweed Smallweed is offline Selection.EndKey not working in 2010 Windows 7 64bit Selection.EndKey not working in 2010 Office 2010 32bit
Novice
Selection.EndKey not working in 2010
 
Join Date: Aug 2013
Posts: 13
Smallweed is on a distinguished road
Default Selection.EndKey not working in 2010

I've recently migrated some XP templates to 2010 and am now having problems with some of my VBA that should be inserting AutoText (which consists of some text and a table) at the end of the document. The code is:



Selection.EndKey Unit:=wdStory
ActiveDocument.AttachedTemplate.AutoTextEntries("m yStandardText") _
.Insert Where:=Selection.Range, RichText:=True

When the macro runs normally it's as if the Selection.EndKey line is being completely ignored because my AutoText ends up wherever the cursor happens to be.

The strange thing is that if I put a breakpoint anywhere before this line and then once it's stopped, press the run button/press F5, all runs as it should.

This almost feels like some kind of "refresh" issue, as if the code is just running too quickly and performing the insertion of the AutoText before the cursor gets the chance to move. I've tried putting an ActiveDocument.Repaginate before the above code but that doesn't help.

Any thoughts mightily appreciated...
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Selection.EndKey not working in 2010 Outlook 2010 rule not working khughes46 Outlook 1 05-06-2014 10:09 AM
Selection.EndKey not working in 2010 Selection of all Text for a specific page in word is spanning selection across pages ramsgarla Word VBA 9 12-05-2012 03:23 AM
Word 2010 - Specify working area Toni Chaffin Word 1 09-14-2012 02:46 AM
Outlook 2010 AutoConfigure not working vors Outlook 0 07-03-2012 08:46 AM
templates not working in 2010 normle Excel 0 01-24-2012 02:10 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:03 AM.


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