Results 1 to 6 of 6
  1. #1
    Silver Lounger
    Join Date
    Jul 2001
    Location
    Ottawa, Ontario, Canada
    Posts
    1,609
    Thanks
    0
    Thanked 1 Time in 1 Post

    Control of File Properties (VBA/Word-Excel/2000)

    This seems like such an obvious thing, that I cannot believe it will be awkward in VBA code. Can someone please advise me on the appropriate code to read and control the text that appears in the Comment box of the File | Properties panel. See attached.
    Regards
    Don

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Control of File Properties (VBA/Word-Excel/2000)

    In Word, it's ActiveDocument.BuiltInDocumentProperties(wdPropert yComments).

    MsgBox ActiveDocument.BuiltInDocumentProperties(wdPropert yComments)

    ActiveDocument.BuiltInDocumentProperties(wdPropert yComments) = "Hello World"

    In Excel, it's slightly different: ActiveWorkbook.BuiltinDocumentProperties("Comments ")

  3. #3
    Silver Lounger
    Join Date
    Jul 2001
    Location
    Ottawa, Ontario, Canada
    Posts
    1,609
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Control of File Properties (VBA/Word-Excel/2000)

    As always Hans; Thank you.
    Do you never sleep?
    Regards
    Don

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Control of File Properties (VBA/Word-Excel/2000)

    <img src=/S/yawn.gif border=0 alt=yawn width=15 height=15>

  5. #5
    Silver Lounger
    Join Date
    Jul 2001
    Location
    Ottawa, Ontario, Canada
    Posts
    1,609
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Control of File Properties (VBA/Word-Excel/2000)

    I am continually having problems of this sort and spend too much time digging up the correct code. Can you point me to a good cross reference that will take me from the Office pull down commands to the corresponding VBA code? The only one I am aware of is Hans V.
    Regards
    Don

  6. #6
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Control of File Properties (VBA/Word-Excel/2000)

    I often find the quickest way to zero in on something is to type it (or the part of it you know) into the VBA editor, then hit F1 to bring up Help (hoefully) at the appropriate keyword. If I type "documentproperties", the help opens at "DocumentProperties Collection Object". The blurb leads me to "CustomDocumentProperties". As I type "CustomDo" into the keywords dialog, up comes "CustomDocumentProperties Property". The "See Also" takes me to "BuiltInDocumentProperties Property", from where I see (finally) a mention of "wdPropertyComments".

    Sounds tiring, but it's just a few logical steps really.

    Alan

Posting Permissions

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