none
How to change the properties from word programatically RRS feed

  • Question

  • Regards. 
    Is there any way to change the properties of word with programming. Net, visual basic?.

    I've seen something like

        Private Wapp As Word.Application
        Private docWord As Word.Document
        Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Click
            Dim _BuiltInProperties As Object = docWord.BuiltInDocumentProperties
            If Not _BuiltInProperties Is Nothing Then
                _BuiltInProperties("Title").Value = txtTitle.Text.Trim()
                _BuiltInProperties("Subject").Value = txtSubject.Text.Trim()
                _BuiltInProperties("Author").Value = txtAuthor.Text.Trim()
                _BuiltInProperties("Manager").Value = txtManager.Text.Trim()
                _BuiltInProperties("Company").Value = txtCompany.Text.Trim()
                _BuiltInProperties("Category").Value = txtCategory.Text.Trim()
                _BuiltInProperties("Keywords").Value = txtKeyWords.Text.Trim()
                _BuiltInProperties("Comments").Value = txtComment.Text.Trim()
            End If
            MessageBox.Show("Summery has been updated successfully")
            If Not docWord Is Nothing Then
                docWord.Close()
            End If
            If Not Wapp Is Nothing Then
                Wapp.Quit()
            End If
    
        End Sub
    But that only works with properties there, you can not change such "creation date", "last print date", etc.. 
    I need to change these properties. 
    Also I think for this to work should have the word api in my server, ie to install word on the server, and do not know if this will be possible. 
    What would be the best froma do? 

    Friday, March 21, 2014 5:46 PM

Answers

All replies