Results 1 to 8 of 8
  1. #1
    New Lounger
    Join Date
    Sep 2001
    Location
    UK
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Word Document Properties (VB6)

    Hi,
    Does anyone know if it's possible to access the properties of a Word document using Vb?
    (eg title, author, subject - etc - the stuff you get by right clicking on the file)

    Thanks
    Roger

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Word Document Properties (VB6)

    Hi,
    I think Document.BuiltInDocumentProperties is what you're looking for - I'm assuming this works in VB the same as it does in VBA.
    Hope that helps.
    Regards,
    Rory

    Microsoft MVP - Excel

  3. #3
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Word Document Properties (VB6)

    Roger,

    You can access most (Office) file properties from VB, without needing to open the file, by using the DSO property reader, which is an .exe that's available for download from MS.

    See <A target="_blank" HREF=http://www.wopr.com/cgi-bin/w3t/showthreaded.pl?Cat=&Board=xl&Number=40226&Search= true&Forum=All_Forums&Words=40226&Match=MessNum&Se archpage=0&Limit=25&Old=allposts&Main=39959>this post</A> and the ones that follow it for more detailed info.

    Gary

  4. #4
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Word Document Properties (VB6)

    In order to use BuiltInDocumentProperties, you will need to add a reference to the MS Word object library in your project and you will also need to open the file, but not make it visible. Reply back if you need more details. --Sam
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

  5. #5
    New Lounger
    Join Date
    Sep 2001
    Location
    UK
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word Document Properties (VB6)

    Hi,

    cheers for all the help, guys

    It's working great now!!

  6. #6
    Silver Lounger Charles Kenyon's Avatar
    Join Date
    Jan 2001
    Location
    Sun Prairie, Wisconsin, Wisconsin, USA
    Posts
    2,049
    Thanks
    124
    Thanked 119 Times in 116 Posts

    Re: Word Document Properties (VB6)

    See <A target="_blank" HREF=http://www.mvps.org/word/FAQs/MacrosVBA/DSOFile.htm> How can I get access to the Document Properties of a Word file without opening the document?</A> on the MVP FAQ site.
    Charles Kyle Kenyon
    Madison, Wisconsin

  7. #7
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word Document Properties (VB6)

    Do any of your documents have a password?

    I tried DSO access to document properties and found that DSO calls respect open and read only passwords; therefore, doc properties are not accessible for these docs.

    What have you found?
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  8. #8
    New Lounger
    Join Date
    Sep 2001
    Location
    UK
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word Document Properties (VB6)

    Hi,

    Attached is the source code that gets office document properties, with or without password protection on the documents.

    Roger
    Attached Files Attached Files

Posting Permissions

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