• word basic code auto open to max size in my normal.dot error message in word 365 works fine early

    Home » Forums » AskWoody support » Productivity software by function » MS Word and word processing help » word basic code auto open to max size in my normal.dot error message in word 365 works fine early

    Author
    Topic
    #497677

    I am using my normal.dot from “forever” in word 365
    I find that an old “auto open ” code in the normal.dot file is hanging when I open a word document from say an email that causes the document to open in protected view/ read only, it errors out that this code
    Public Sub MAIN()
    If Not WordBasic.AppMaximize() Then WordBasic.AppMaximize
    If Not WordBasic.DocMaximize() Then WordBasic.DocMaximize
    End Sub

    error message 509 in Microsoft visual basic the doc maximize command is not available because this command is not available for reading
    Is there a more up to date “code”
    Thanks
    JK

    Viewing 1 reply thread
    Author
    Replies
    • #1479686

      The DocMaximize function isn’t needed in the latest Word versions because it no longer has any purpose.

      In the old (Word 95 and earlier) versions that contained WordBasic, there were two types of display: Single Document Interface (SDI) allows only one document per program window, and Multiple Document Interface (MDI) allows two or more documents to display child windows inside the main program window (http://msdn.microsoft.com/en-us/library/b2kye6c4.aspx). The purpose of the DocMaximize command was to maximize a child window in an MDI display.

      Newer versions of Word, and specifically Word 2013 that’s part of Office 365, do not offer MDI. Every document is always maximized within its program window; only the program window can be maximized, minimized, or restored.

      Just edit the macro to comment out or delete the DocMaximize line. (I’d advise updating all macros to replace WordBasic references with their VBA equivalents wherever possible, but that’s probably more work than you want to take on.)

    • #1479856

      thank you for explaining all this much appreciated

    Viewing 1 reply thread
    Reply To: word basic code auto open to max size in my normal.dot error message in word 365 works fine early

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: