Results 1 to 13 of 13

Thread: VB 6.0 Help

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2004
    Location
    India
    Posts
    12

    Angry VB 6.0 Help

    Hi all

    I m in a critical situation.I want a vb code to edit the author and company of files in a folder.

    Hope a reply soon
    Anil

  2. #2
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989
    I am not sure if that is possible.. and only exe files hold those information (copyright and all that)...

  3. #3
    Lively Member Bolerophone's Avatar
    Join Date
    Dec 2003
    Location
    Himalayas
    Posts
    123
    Anil,

    I found this in MSDN:

    SpyWorks-VB -- is an advanced development tool for use with Visual Basic. The SpyWorks-VB package supports true owner-draw list boxes, in which you can draw each entry under program control in any manner that you wish. Desaware also has a custom control called "Storage Tools" that provides "OLE Structured Storage."

    For example, you can use the control to access the summary information properties of office documents such as author, subject, title, comments, etc. Visit Desaware's website for more info:
    www.desaware.com.


    -Amresh Tripathi-

  4. #4

    Thread Starter
    New Member
    Join Date
    Oct 2004
    Location
    India
    Posts
    12

    Thanks Amrish

    Thanks!

    But the link you have given is not working
    (www.desaware.com.).Can you please post the code will be highly appreciable

    Anil Paul.

  5. #5
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106
    The link is not working, but you might google it.

    However, the chances that a commercial software company would have source code that could be pasted onto a public forum on their website is negligible.
    My usual boring signature: Nothing

  6. #6
    Lively Member Bolerophone's Avatar
    Join Date
    Dec 2003
    Location
    Himalayas
    Posts
    123

    Desaware.com

    Here is the company's address as mentioned in MSDN


    FarPoint Technologies, Inc., 585A Southlake Boulevard,
    Southport Office Park Richmond, VA 23236
    Sales/Info: (800) 645-5913 or (804) 378-0432
    Tech Support: (804) 378-1011
    FAX: (804) 378-1015

    I agree with shaggy that they won't give you the source code easily. BTW what kind of documents are these for whom you want to edit the Author etc...

    For eg I know how to set these properties for an Excel document generated using VB6.

    Here you can use BuiltinDocumentProperties Property.
    This property returns the entire collection of built-in document properties. Use the Item method to return a single member of the collection (a DocumentProperty object) by specifying either the name of the property or the collection index (as a number).

    You can refer to document properties either by index value or by name. The following list shows the available built-in document property names:

    Title
    Subject
    Author****************************
    Keywords
    Comments
    Template
    Last Author
    Revision Number
    Application Name
    Last Print Date
    Creation Date
    Last Save Time
    Total Editing Time
    Number of Pages
    Number of Words
    Number of Characters
    Security
    Category
    Format
    Manager
    Company ****************
    Number of Bytes
    Number of Lines
    Number of Paragraphs
    Number of Slides
    Number of Notes
    Number of Hidden Slides
    Number of Multimedia Clips
    Hyperlink Base
    Number of Characters (with spaces)

  7. #7
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901
    I hope that it is at the request of the original author. Not sure that it'd be legal any other way!

  8. #8

    Thread Starter
    New Member
    Join Date
    Oct 2004
    Location
    India
    Posts
    12

    Thank you All

    Hello

    What I need to do is there will be many msword doc files in a folder and what my boss want is he have to edit the author name and company name of those files

    Please suggest

    Thanks
    Anil

  9. #9
    Frenzied Member trisuglow's Avatar
    Join Date
    Jan 2002
    Location
    Horsham, Sussex, UK
    Posts
    1,536
    This code works for VB6 SP5 and Word 2000. You will need to set a Project Reference to the Word Object Library.


    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub Form_Load()
    4.   Dim wa As New Word.Application
    5.   Dim wd As New Word.Document
    6.   Dim dp As Object
    7.  
    8.   wa.Documents.Open "C:\Sample.doc" 'Use your own document here.
    9.   Set wd = wa.Documents(1)
    10.   Set dp = wd.BuiltInDocumentProperties
    11.   dp("Author") = "new author - was " & dp("Author")
    12.   dp("Company") = "new company - was " & dp("Company")
    13.   wd.Close True
    14. End Sub
    This world is not my home. I'm just passing through.

  10. #10

    Thread Starter
    New Member
    Join Date
    Oct 2004
    Location
    India
    Posts
    12

    Thanks trisuglow

    Hello

    Thanks very much for the code.I am now downloading the SP5 of vb6 .Now on running it shows the error

    User defined files not found!

    I will try it after installing sp5.
    Any way thanks for your help

    Anil

  11. #11
    PowerPoster Deepak Sakpal's Avatar
    Join Date
    Mar 2002
    Location
    Mumbai, India
    Posts
    2,424
    have u set Project Reference to the Word Object Library.

    Microsoft Word 9.0 object Library.

    You may have different version.

  12. #12

    Thread Starter
    New Member
    Join Date
    Oct 2004
    Location
    India
    Posts
    12

    Thank you Very Much Deepak

    Its works fine now

    Thanks alot.

    May God Bless you

    Anil

  13. #13
    Lively Member Bolerophone's Avatar
    Join Date
    Dec 2003
    Location
    Himalayas
    Posts
    123

    Question

    Originally posted by dglienna
    I hope that it is at the request of the original author. Not sure that it'd be legal any other way!
    I didnt understand. The code posted by me is for the Excel Object.
    Also in place of excel Anil you can reference the Word objects.

    -amresh-

Posting Permissions

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



Click Here to Expand Forum to Full Width