PDA

View Full Version : Set Start locations (seems to now be impossible with AutoNew)



gmaxey
03-11-2019, 11:50 AM
What has Microsoft done to break Word? For years, I have used a simple line of code to set the start location when creating a new document.

The

Sub AutoNew()
ActiveDocument.SelectContentControlsByTitle("Target").Item(1).Range.Select
MsgBox Selection.Range.Text 'Words as the message box returns the text, in the target content control
'But when the code completes and the document is displayed, the cursor is at the top of the page and not the range just selected!!
End Sub

gmayor
03-11-2019, 11:13 PM
I am not sure that it has. I am pretty sure I have the latest build and that macro still works here as it should, leaving the selection in the content control.

gmaxey
03-12-2019, 06:16 AM
Graham,

Strange. It is broke here with all versions of Word 2007. I can't say for sure, but it might have something to do with Windows10. Perhaps there some obscure setting somewhere. I'll have to investigate.

Thanks.

gmaxey
03-12-2019, 06:31 AM
I write this while picking crow feathers from my teeth. Microsoft is not to blame. The wound was self inflicted. At some point, and for some reason that I fail to recall, I had added a line to class procedure that sets view and zoom for all documents when created or opened. It was causing this behavior.

Sorry for the false alarm.