![]() |
#1
|
|||
|
|||
![]()
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... |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
khughes46 | Outlook | 1 | 05-06-2014 10:09 AM |
![]() |
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 |