none
2010 Microsoft Word>Design Mode>Properties

    Question

  • When in Design Mode of Microsoft Word, you can change the Properties (i.e. AutoFormOverride, EmbedSmartTags, SaveSubsetFonts, etc.).  Does anyone have a list of definitions/explanations for each of the Properties names or where I might locate them?

    More specifically, I created a template in Word and I am attempting to minimize the window size for this template only and hoping that it will remain the same size each time I open it.  Any ideas how?

    Thanks in advance!

    Patrick


    Patrick
    Tuesday, November 23, 2010 4:09 AM

Answers

  • Hi Patrick

    <<WOuld you have any idea how I would do a macro command to adjust the window size of the template?>>

    Well, normally the user is working with a document created from a template, not with the template itself. Assuming this is what you really mean, put two macros in a module in the template. The name of one is AutoOpen, the other is AutoNew. These will trigger when any document created from the template is opened or created (and will also trigger when the template is opened, unless you want to stop that from happening, meaning you'd need additional code):

    Sub AutoOpen()
        AdjustWinSize
    End Sub

    Sub AutoNew()
        AdjustWinSize
    End Sub

    Sub AdjustWinSize()
      With ActiveDocument.ActiveWindow
        .WindowState = wdWindowStateNormal
        .Height = 100
      End With
    End Sub


    Cindy Meister, VSTO/Word MVP
    Wednesday, November 24, 2010 5:21 PM

All replies

  • Hi Patrick,

    Is that a Word AddIn project? What's the version of VS and Office?

    Best Regards,
    Amy Li
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Tuesday, November 23, 2010 6:44 AM
  • Hi Patrick

    In the Visual Basic Editor (press Alt+F11 in the Word UI), press F2 to open the Object Browser. Type the term you're interested in into the "Find" box, then click the "Binoculars" next to it. That will bring up a list of where the term is found in the object model. You'll see, for example, that AutoFormatOverride is a property of the Document object (as are most of the things you see in the Properties list).

    Note that if you activate the "ThisDocument" module of any Project in the "Project" window you'll see this list in the "Properties" window, which will make your work in the Object Browser easier.

    But I think you'll need a macro in the document in order to control the window size when the document is opened (or an add-in that checks something about the document then adjusts the window size accordingly). Window size is not a document property, it's an application property. Word will open the document in the same window size as the currently active document. Only code can affect this.

    WHY would you want to minimize a template (or its documents)? Maybe there's a different way to do what you're trying to do...


    Cindy Meister, VSTO/Word MVP
    Tuesday, November 23, 2010 8:26 AM
  • Thank you Cindy for you help!  I want to reduce the Window size because the template that I have is a single line.  The window simply needs more width than depth.

    I was reading that I can adjust the default settings of Word through Winword.  However, I believe this would affect all documents and not just the one template.  I'll have to play around with it some more.

    I was browsing the web last night and came across this link.  It's a list of all the Document Properties in Microsoft Word 2010.  YOu can update the version too.

    http://msdn.microsoft.com/en-us/library/microsoft.office.tools.word.document_properties(v=VS.100).aspx

    I will keep playing around with it to see if I can get it to do what I need.  I know some things about macros on Word.  WOuld you have any idea how I would do a macro command to adjust the window size of the template?

    Thanks again!

    Patrick


    Patrick
    Tuesday, November 23, 2010 12:27 PM
  • Hi Patrick

    <<WOuld you have any idea how I would do a macro command to adjust the window size of the template?>>

    Well, normally the user is working with a document created from a template, not with the template itself. Assuming this is what you really mean, put two macros in a module in the template. The name of one is AutoOpen, the other is AutoNew. These will trigger when any document created from the template is opened or created (and will also trigger when the template is opened, unless you want to stop that from happening, meaning you'd need additional code):

    Sub AutoOpen()
        AdjustWinSize
    End Sub

    Sub AutoNew()
        AdjustWinSize
    End Sub

    Sub AdjustWinSize()
      With ActiveDocument.ActiveWindow
        .WindowState = wdWindowStateNormal
        .Height = 100
      End With
    End Sub


    Cindy Meister, VSTO/Word MVP
    Wednesday, November 24, 2010 5:21 PM
  • Bless you, Cindy!  I appreciate all your help!  I wish there was a way i could re-pay you for your generosity!

    Patrick

     


    Patrick
    Saturday, November 27, 2010 4:00 PM