Consulting

Page 1 of 3 1 2 3 LastLast
Results 1 to 20 of 47

Thread: Solved: Custom properties from Normal.dot doesn't reproduce in new documents

  1. #1

    Solved: Custom properties from Normal.dot doesn't reproduce in new documents

    Hi

    I have some custom properties in my templates (i.e. letter.dot) that I use.
    And these work like a charm.

    I also have the same custom properties in the Normal.dot but they will not reproduce when I create a new document based on this normal.dot.

    Why is that?


    Thanks
    Grodan

  2. #2
    Knowledge Base Approver
    Space Cadet
    VBAX Tutor sandam's Avatar
    Joined
    Jan 2005
    Location
    London
    Posts
    292
    Location
    Hi there.

    Just a quick suggestion, would it be possible to post your normal.dot as an attachment (you need to zip it first and use the advanced posting option)? It might help to narrow the problem down. And also if you described the properties in your normal.dot that you are trying to reproduce.

    Andrew;?
    Nothing annoys a non-conformist more than other non-conformists who refuse to conform to the rules of non-conformity.


    Confused is my normal state of mind


  3. #3
    VBAX Master TonyJollans's Avatar
    Joined
    May 2004
    Location
    Norfolk, England
    Posts
    2,291
    Location
    Also posted at Tek-Tips, so far with no helpful answers.

    Interesting observation and, sorry, I don't know the answer either

    It's just the way it is. I think it's a sensible, if not entirely intuitive, compromise by Microsoft but I have never seen anything which explains (or even documents) it.
    Enjoy,
    Tony

    ---------------------------------------------------------------
    Give a man a fish and he'll eat for a day.
    Teach him how to fish and he'll sit in a boat and drink beer all day.

    I'm (slowly) building my own site: www.WordArticles.com

  4. #4
    VBAX Wizard
    Joined
    May 2004
    Posts
    6,710
    Location
    It may help if you could give some more details of these.

    I am trying to understand what the relevance is of letter.dot. Is the point that you can use custom properties of letter.dot (and presumably any other USER created template), but you can not use custom properties of normal.dot.?

    Sorry, but that is the way it is.

    There are only a very few Properties of Normal.dot that are carried into a new document.

    Author and Company for example. Everything else is not...which actually makes sense.

    Even real custom properties, such a Client are not carried into the newly created document, by default.

    As has been pointed out, you CAN carry them over to a new document by code.

  5. #5
    Administrator
    VP-Knowledge Base VBAX Guru MOS MASTER's Avatar
    Joined
    Apr 2005
    Location
    Breda, The Netherlands
    Posts
    3,281
    Location
    Hi,

    Well the true reason for this liese somewhere in the dungeons of Microsoft. Like Tony I didn't read anything about it ever...

    I go with Gerry that it is design by default for a purpose..
    Normal.dot is the mother of all templates...when Word is concerned that is.

    It's the default for all new documents made from a Word session. I thinks that is the reason Documentproperties aren't transported to the document.

    In a template you build for a specific purpose MS can acspect you to want that inheritance of that Template. (Cause you always no you are creating a document based on that template)

    Normal.dot is used every time you make a new document. And I'm sure that for most people the documents they make from day to day are always for different topics. So properties for one document should not appear in each document made by Word.

    I hope I explained it alright cause I truly believe that is the reason for MS to do so.

    HTH,
    _________
    Groetjes,

    Joost Verdaasdonk
    M.O.S. Master

    Mark your thread solved, when it has been, by hitting the Thread Tools dropdown at the top of the thread.
    (I don't answer questions asked through E-mail or PM's)

  6. #6
    Thanks for your answers, and ofcourse thanks again to fumei as he answered in Tek-Tips aswell. =]

    I buy your explenation MOS MASTER.

    I'll proberbly create the properties in Document_New.


    Thanks again =]
    Grodan

  7. #7
    VBAX Master TonyJollans's Avatar
    Joined
    May 2004
    Location
    Norfolk, England
    Posts
    2,291
    Location
    Having thought about this a bit, you don't really base documents on Normal at all, it's more that Normal is attached to them if you don't explicitly base them on something else (in the same way that Normal is temporarily attached to them if the base template can't be located). Normal is simply there because that's the way Word works - it needs a template and if you don't supply one it (rather grudgingly) uses its own but it doesn't do the full template thing.

    Thanks for the question - it's made me think - something I don't always do
    Enjoy,
    Tony

    ---------------------------------------------------------------
    Give a man a fish and he'll eat for a day.
    Teach him how to fish and he'll sit in a boat and drink beer all day.

    I'm (slowly) building my own site: www.WordArticles.com

  8. #8
    Hi again =]

    The reason that I'd like to have custom properties in documents based on Normal.dot and not only documenct based on other templates (i.e. letter.dot, minutes.dot, report.dot) is


    • For quality resons.
      In the custom properites it is possible, via a simple user form, to save data to ensure som degree of quallity and trackability (I don't even now if that is a word?).
    • For the average user.
      The averagre user don't always think when he is about to create a document for a project that there are now specific template for. He/she only press the blank-document-icon and gets a document based on Normal.dot.
    In the custom properties I i.e. save data about:

    • If the document should ha a logo inside or if the document should be printed on letter paper or there should be no logo at all.
    • Date of the document.
    • Version of the document.
    • Project no.
    • Project name.
    • Creator.
    All this data gives me some status/quality about the Word-document.


    From http://www.tek-tips.com/viewthread.cfm?qid=1120797 and TonyJollans.
    You can put code in Document_New if that's what you want but you should be aware that it doesn't fire when you open up Word and get a new empty document by default; it only fires when you explicitly create a new document from within Word.
    So the Normal.dot don't respond at all as the template files in common?


    /Grodan

  9. #9
    VBAX Master TonyJollans's Avatar
    Joined
    May 2004
    Location
    Norfolk, England
    Posts
    2,291
    Location
    Hi Grodan,

    No, whn you press the "New" icon, or go via File > New, in Word then events in Normal fire as they do in any other template.

    It's when you start Word (from Windows) without a document and get a blank one by default - it's then that Normal's Document_New doesn't fire (in fact the only event you can use in those circumstances is the Application Document Change event but that fires on lots of other occasions too).
    Enjoy,
    Tony

    ---------------------------------------------------------------
    Give a man a fish and he'll eat for a day.
    Teach him how to fish and he'll sit in a boat and drink beer all day.

    I'm (slowly) building my own site: www.WordArticles.com

  10. #10
    VBAX Wizard
    Joined
    May 2004
    Posts
    6,710
    Location
    Grodan, please think about the following - a quote from you....

    In the custom properties I i.e. save data about:

    If the document should ha a logo inside or if the document should be printed on letter paper or there should be no logo at all.
    Think about it. REALLY think about it.

    You want to save data about IF...blah blah blah.

    IF????? You want to store data on logic? Surely not. It would be possible to store logical information, but you sure as heck would not use custom properties to do so.

    You could store something that is the RESULT of logic statements IF this, do that. Look at DOCVARIABLE for a start.

    I am going to rant further:

    1. I am sorry, but it is long past the time to baby sit users to the degree you mention. If a user is working on a project, and their new documents should be using a specific template then they should be trained to use it.

    2. Put a button on the toolbar that makes a document based on that template...forget about the new document button. Heck, take it right off the toolbar!

    3. All the data you want to be captured from quality control reasons....ALL of this stuff should be in the template used. It should NOT be in Normal.dot. All of the data you mantion is easily built and retained in a document based on a template.

  11. #11
    Administrator
    VP-Knowledge Base
    VBAX Guru MOS MASTER's Avatar
    Joined
    Apr 2005
    Location
    Breda, The Netherlands
    Posts
    3,281
    Location
    Quote Originally Posted by TonyJollans
    Having thought about this a bit, you don't really base documents on Normal at all, it's more that Normal is attached to them if you don't explicitly base them on something else (in the same way that Normal is temporarily attached to them if the base template can't be located). Normal is simply there because that's the way Word works - it needs a template and if you don't supply one it (rather grudgingly) uses its own but it doesn't do the full template thing.

    Thanks for the question - it's made me think - something I don't always do
    Hi Tony,

    Somehow it must be a language thing but I think when pressing the new button you do base (And attach) a new document on Normal.dot!

    You must mean something else then me but I'm not getting this one....

    Take a very simple test:
    Open Normal.dot and write youre name in the body of the document and save it.

    Now close Word.
    Reopen and what do you see....Your name! So the new document is fully based on Normal.dot. (And again and again when you press New button)

    Also styles and other stuff from Normal are available due to the attaching of Normal. The test with the text proves that Word does something like: [vba]
    Documents.Add(Normaltemplate.FullName)
    [/vba] when pressing New button.

    Perhaps you meant something else and its already late over here so I'm probably not getting it...but IMO all new documents are based on Normal.dot (When pressing new of course in normal setup)

    Later ....
    _________
    Groetjes,

    Joost Verdaasdonk
    M.O.S. Master

    Mark your thread solved, when it has been, by hitting the Thread Tools dropdown at the top of the thread.
    (I don't answer questions asked through E-mail or PM's)

  12. #12
    VBAX Master TonyJollans's Avatar
    Joined
    May 2004
    Location
    Norfolk, England
    Posts
    2,291
    Location
    Sorry Joost, it's just me thinking aloud really.

    Just trying to make sense of what it is that Word does. It's not just the properties, it's other little things like events not firing when a new document is automatically created based on Normal when you start up Word. Normal is not like any other template and documents based on Normal are not quite llike documents based on other templates.

    I have no real knowledge, I'm just trying to interpret what happens in a way I can explain - which I've obviously failed at so far
    Enjoy,
    Tony

    ---------------------------------------------------------------
    Give a man a fish and he'll eat for a day.
    Teach him how to fish and he'll sit in a boat and drink beer all day.

    I'm (slowly) building my own site: www.WordArticles.com

  13. #13
    Administrator
    VP-Knowledge Base
    VBAX Guru MOS MASTER's Avatar
    Joined
    Apr 2005
    Location
    Breda, The Netherlands
    Posts
    3,281
    Location
    Quote Originally Posted by TonyJollans
    I have no real knowledge, I'm just trying to interpret what happens in a way I can explain - which I've obviously failed at so far
    Same here....(Remember I read english different then you)

    I do agree the ways of Word are often a mistory!!! That's why it's my favourite app....Never a dull moment.

    And your knowledge never fails my dear Sir!
    _________
    Groetjes,

    Joost Verdaasdonk
    M.O.S. Master

    Mark your thread solved, when it has been, by hitting the Thread Tools dropdown at the top of the thread.
    (I don't answer questions asked through E-mail or PM's)

  14. #14
    VBAX Master TonyJollans's Avatar
    Joined
    May 2004
    Location
    Norfolk, England
    Posts
    2,291
    Location
    Never a dull moment indeed
    Enjoy,
    Tony

    ---------------------------------------------------------------
    Give a man a fish and he'll eat for a day.
    Teach him how to fish and he'll sit in a boat and drink beer all day.

    I'm (slowly) building my own site: www.WordArticles.com

  15. #15
    Administrator
    VP-Knowledge Base
    VBAX Guru MOS MASTER's Avatar
    Joined
    Apr 2005
    Location
    Breda, The Netherlands
    Posts
    3,281
    Location
    Hihihi....
    _________
    Groetjes,

    Joost Verdaasdonk
    M.O.S. Master

    Mark your thread solved, when it has been, by hitting the Thread Tools dropdown at the top of the thread.
    (I don't answer questions asked through E-mail or PM's)

  16. #16
    VBAX Wizard
    Joined
    May 2004
    Posts
    6,710
    Location
    When Word itself is loaded it makes a document with the contents of normal.dot. Which is why Document_New does not fire. Clicking the New button does of course fire it.

  17. #17
    Hi

    Quote Originally Posted by fumei
    Think about it. REALLY think about it.

    You want to save data about IF...blah blah blah.

    IF????? You want to store data on logic? Surely not. It would be possible to store logical information, but you sure as heck would not use custom properties to do so.

    You could store something that is the RESULT of logic statements IF this, do that. Look at DOCVARIABLE for a start.
    Hmm, I don't know what you are getting at here.
    I store values like "logo", "no_logo" or "letter" in a custom property. I can't see why this is wrong or where else I should contain the status? Maybe I'm missing something important here?

    Quote Originally Posted by fumei
    1. I am sorry, but it is long past the time to baby sit users to the degree you mention. If a user is working on a project, and their new documents should be using a specific template then they should be trained to use it.
    I know. =]
    And it looks like my intention didn't work out, and maybe I need to create at template for an empty document aswell. I just thought that I would spare the user some mouse clicks.

    Can I disable a toolbar when the user has at document based on Normal.dot?

    Quote Originally Posted by fumei
    2. Put a button on the toolbar that makes a document based on that template...forget about the new document button. Heck, take it right off the toolbar!
    Hmm, that would be nice. How do I do that?
    And can I also choose to not have a blank document at program start up?

    Quote Originally Posted by fumei
    3. All the data you want to be captured from quality control reasons....ALL of this stuff should be in the template used. It should NOT be in Normal.dot. All of the data you mantion is easily built and retained in a document based on a template.
    They are in the specific templates I have created (i.e. letter, minutes and fax).
    The only reason of my wish to have the custom properties in the Normal.dot aswell is because the user often create a document based on the Normal.dot (since it is there when the program opens). But if I can control things in the toolbars (remove the blank document button) and be able to block the startup document then this will be solved.

    Many thanks for your thoughts

    /Grodan

  18. #18
    Knowledge Base Approver
    Space Cadet
    VBAX Tutor sandam's Avatar
    Joined
    Jan 2005
    Location
    London
    Posts
    292
    Location
    Here's a thought, and I'll post a link to the KB entry about creating custom toolbars in Word as well.

    You can add a module of code to the Normal.dot, you can also add a custom toolbar.

    So, my suggestion is combine the two. You add a toolbar with buttons representing each of the templates you need to create. Then, you already have the templates (perhaps not a blank one, but thats easily done). Then when the user loads Word, because you have the toolbar and the code module. You can use the toolbar buttons to create a new document based on whatever template is required. This way, the user does not have to goto a template directory etc. and Word can remain running which will make creating the new documents from the templates marginally faster as Word does not have to realod its instance each time.

    HTH

    Andrew;?

    Custom Menus and Toolbars
    Nothing annoys a non-conformist more than other non-conformists who refuse to conform to the rules of non-conformity.


    Confused is my normal state of mind


  19. #19
    Hmm, if I understand you right then it's not really what I want.
    I'd like to disable the "blank document button" or maybe remove the same.
    Then I also would like to block the "doc1" that is created when Word starts, so that there is no page or a page of my choice.

  20. #20
    Knowledge Base Approver
    Space Cadet VBAX Tutor sandam's Avatar
    Joined
    Jan 2005
    Location
    London
    Posts
    292
    Location
    IMHO I dont think whaqt your asking for is possible. Its taking the customization of Word beyond whats meant to be capable of and that is always a tricky one.
    Nothing annoys a non-conformist more than other non-conformists who refuse to conform to the rules of non-conformity.


    Confused is my normal state of mind


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •