Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    Jun 2002
    Location
    Johannesburg, Gauteng, South Africa
    Posts
    59
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Update Title in Document Properties (Word 2000)

    Good Afternoon,
    I need to pass a text string derived from two text boxes in a user form to the Document Title (BuiltInDocumentProperties.wdPropertyTitle). According to the VBE help the BuiltInDocumentProperties is read only. Post: 123696 from jscher2000 led me to download DSOfile.exe but having done so, I am no further on. I have installed it but do not know how to use it. My knowledge of VB is very limited and has been garnered very much on a trial and error basis. Can anyone please help? Many Thanks

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

    Re: Update Title in Document Properties (Word 2000)

    Some properties are read-only, but anything that you can change with the normal dialog you can change with VBA. Something like this should work. HTH --Sam
    <pre>Option Explicit

    Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
    ActiveDocument.BuiltInDocumentProperties(wdPropert yTitle) = _
    TextBox1.Text & TextBox2.Text
    End Sub</pre>

    <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>

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Update Title in Document Properties (Word 2000)

    If you are working from inside Word, you won't need DSOfile.exe. Instead, you can use the syntax given by Sam. If you are working from a VB program, then you could use automation to open the Word document and, possibly changing ActiveDocument to some other object reference, use that same syntax. If you don't want to open the document, then you would need to use DSOfile.exe. I've downloaded it but never actually used it, so without some experimentation, I can't tell you the syntax for that. Hope this clarifies.

  4. #4
    Star Lounger
    Join Date
    Jun 2002
    Location
    Johannesburg, Gauteng, South Africa
    Posts
    59
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Thanks Folks

    Thanks SammyB and jscher2000, your suggestion worked a treat working from inside Word - greatly appreciated.

Posting Permissions

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