Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-15-2011, 06:05 AM
cprelude cprelude is offline Word 2010: always open in Draft View Windows 7 64bit Word 2010: always open in Draft View Office 2010 32bit
Novice
Word 2010: always open in Draft View
 
Join Date: Dec 2011
Posts: 9
cprelude is on a distinguished road
Question Word 2010: always open in Draft View

Hi there,


I have the following working fine when I open word and create a New Document. Anyone know how to get this macro to run as word is opening? I.e., I mean by this when I actually run the programme, cannot get the programme to run this macro automatically when it OPENS? As opposed to me having to click New Document every time I open Word?

Code:
Sub AutoNew()
'Display filename and path in window title bar
ActiveWindow.Caption = ActiveDocument.FullName
'The remaining settings are the same as for autonew
ActiveWindow.ActivePane.DisplayRulers = True
With ActiveWindow.View
  .Type = wdNormalView
  .Zoom.Percentage = 160
  'fix the tiny cursor error
End With
End Sub

Last edited by macropod; 12-19-2011 at 06:52 PM. Reason: Fixed code presentation
Reply With Quote
  #2  
Old 12-15-2011, 12:21 PM
Stefan Blom's Avatar
Stefan Blom Stefan Blom is offline Word 2010: always open in Draft View Windows 7 64bit Word 2010: always open in Draft View Office 2010 32bit
Moderator
 
Join Date: Aug 2011
Posts: 3,871
Stefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to all
Default

To get it to work as you open documents within a session, I believe you will have to use the same code in an AutoOpen macro.

Or are you saying that it doesn't work for the blank document that opens when you start Word?
__________________
Stefan Blom
Microsoft Word MVP

Microsoft 365 apps for business
Windows 11 Professional

Last edited by Stefan Blom; 12-16-2011 at 12:55 PM.
Reply With Quote
  #3  
Old 12-16-2011, 10:43 AM
cprelude cprelude is offline Word 2010: always open in Draft View Windows 7 64bit Word 2010: always open in Draft View Office 2010 32bit
Novice
Word 2010: always open in Draft View
 
Join Date: Dec 2011
Posts: 9
cprelude is on a distinguished road
Default

Hi Stefan, the answer to your question is "no" it doesn't appear to work even when I add the same script to an AutoOpen macro.
I just tried simplifying everything and simply am running the following macros for "All Active and Open documents":
Sub AutoNew()
ActiveWindow.View = wdNormalView
End Sub
Sub AutoOpen()
ActiveWindow.View = wdNormalView
End Sub

I am assuming this one will work with Normal.dotm
Anyway, nothing happens.
The test is really that I close Word in Print view, and re-open the programme. It does not open in Draft view - it opens in Print view!
So, whatever I try this will NOT work!
Best wishes,
Paul
Reply With Quote
  #4  
Old 12-16-2011, 12:58 PM
Stefan Blom's Avatar
Stefan Blom Stefan Blom is offline Word 2010: always open in Draft View Windows 7 64bit Word 2010: always open in Draft View Office 2010 32bit
Moderator
 
Join Date: Aug 2011
Posts: 3,871
Stefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to all
Default

Try adding the following line of code:

Options.AllowOpenInDraftView = True

at the beginning of each macro.
__________________
Stefan Blom
Microsoft Word MVP

Microsoft 365 apps for business
Windows 11 Professional
Reply With Quote
  #5  
Old 12-16-2011, 03:47 PM
cprelude cprelude is offline Word 2010: always open in Draft View Windows 7 64bit Word 2010: always open in Draft View Office 2010 32bit
Novice
Word 2010: always open in Draft View
 
Join Date: Dec 2011
Posts: 9
cprelude is on a distinguished road
Default

Hi Stefan...

I've done that...Still, Word open obstinately in Print View.

Here is a screen grab of VB screen (link below), where I created the macros, in-case you can spot anything office.

https://skydrive.live.com/redir.aspx...D6A6BC091D!115
Reply With Quote
  #6  
Old 12-16-2011, 05:20 PM
Stefan Blom's Avatar
Stefan Blom Stefan Blom is offline Word 2010: always open in Draft View Windows 7 64bit Word 2010: always open in Draft View Office 2010 32bit
Moderator
 
Join Date: Aug 2011
Posts: 3,871
Stefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to all
Default

Strange. We must be missing something...

If you run the macro manually, for example by pressing F5 when the insertion point is in the AutoOpen sub in the Visual Basic Editor, then does the view change?
__________________
Stefan Blom
Microsoft Word MVP

Microsoft 365 apps for business
Windows 11 Professional
Reply With Quote
  #7  
Old 12-16-2011, 06:43 PM
cprelude cprelude is offline Word 2010: always open in Draft View Windows 7 64bit Word 2010: always open in Draft View Office 2010 32bit
Novice
Word 2010: always open in Draft View
 
Join Date: Dec 2011
Posts: 9
cprelude is on a distinguished road
Default

Hi there Stefan...Just tried what you suggested, and yes, it works from that view. Pressing F5 in VBE makes the view change fine.

Paul
Reply With Quote
  #8  
Old 12-18-2011, 05:22 PM
Stefan Blom's Avatar
Stefan Blom Stefan Blom is offline Word 2010: always open in Draft View Windows 7 64bit Word 2010: always open in Draft View Office 2010 32bit
Moderator
 
Join Date: Aug 2011
Posts: 3,871
Stefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to all
Default

Apparently something is preventing the auto macros from running correctly. You are running a stand-alone computer (not on a corporate network)?
__________________
Stefan Blom
Microsoft Word MVP

Microsoft 365 apps for business
Windows 11 Professional
Reply With Quote
  #9  
Old 12-18-2011, 11:52 PM
cprelude cprelude is offline Word 2010: always open in Draft View Windows 7 64bit Word 2010: always open in Draft View Office 2010 32bit
Novice
Word 2010: always open in Draft View
 
Join Date: Dec 2011
Posts: 9
cprelude is on a distinguished road
Default

Hi Stefan...Yes, Standalone, home PC setup. I notice that the autoopen macro is running when I open a new document from email (an attachment from email), because I get an error message caused by the document being opened in Protected mode, which there are postings about elsewhere on the web (the macro gets intercepted by the Protected mode if you will, but at least there is proof it is running). However, when I OPEN word from "cold start" it's a no-go on those macros! This was not something I experienced with Word 2007 where the macros ran fine. It's as if somehow Word is just "not seeing them". Or, the rule that tells Word to open in previous view setting is more powerful or something, and trumps the macro. As you can tell I am not a coder, but I do have the "bug" on this one!
Reply With Quote
  #10  
Old 12-19-2011, 12:52 AM
Stefan Blom's Avatar
Stefan Blom Stefan Blom is offline Word 2010: always open in Draft View Windows 7 64bit Word 2010: always open in Draft View Office 2010 32bit
Moderator
 
Join Date: Aug 2011
Posts: 3,871
Stefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to all
Default

This is very strange. I don't know what to suggest next. :-(
__________________
Stefan Blom
Microsoft Word MVP

Microsoft 365 apps for business
Windows 11 Professional
Reply With Quote
  #11  
Old 12-19-2011, 05:11 PM
cprelude cprelude is offline Word 2010: always open in Draft View Windows 7 64bit Word 2010: always open in Draft View Office 2010 32bit
Novice
Word 2010: always open in Draft View
 
Join Date: Dec 2011
Posts: 9
cprelude is on a distinguished road
Default

Hi Stefan...Ah well, thanks for trying. I find it odd that other Word 2010 users don't have the same problem. I wonder if it's something to with Outlook 2010 sharing the Word interface or something. I don't know...
Reply With Quote
  #12  
Old 12-20-2011, 06:23 AM
Stefan Blom's Avatar
Stefan Blom Stefan Blom is offline Word 2010: always open in Draft View Windows 7 64bit Word 2010: always open in Draft View Office 2010 32bit
Moderator
 
Join Date: Aug 2011
Posts: 3,871
Stefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to all
Default

It really is very strange. :-(

I doubt it could be related to Outlook, though. Starting with Office 2007, Outlook no longer "shares" anything with Word; it uses a separate DLL for word processing (and a separate template called NormalEmail.dotm) when you create and read RTF/HTML messages.
__________________
Stefan Blom
Microsoft Word MVP

Microsoft 365 apps for business
Windows 11 Professional
Reply With Quote
Reply

Tags
draft view, macro

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2010 view of cel missing isla Excel 2 09-27-2013 09:35 AM
Word 2010: always open in Draft View My draft message gets deleted from drafts when I send it? Bansaw Outlook 2 07-28-2011 08:45 AM
contact open but can't view? upperhopton Outlook 0 07-27-2011 03:08 AM
Word 2010: always open in Draft View Suddenly cannot view open documents... 2010Problem Word 4 06-05-2011 01:07 PM
Word 2010: always open in Draft View Text created in Work 2010- will not open in Word 2007 Ole Sarge Word 1 05-27-2011 03:06 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:59 AM.


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