Hmm.... I found that both methods work for me, BUT, I did find what seems to me to be a bug in Word:
When the Title (probably applies to other properties, too) is set, then the document must be saved for the change to apply. Changing a Document Property apparently does not set the document state to dirty, so it is not automatically saved upon closing.
So, using .Value will work, as will your method, you just have to explicitly save the document.
hth,
-Peter
"OHM ( Terry Burns )" <me@mine.com> wrote in message news:uLoHNiS6EHA.2876@TK2MSFTNGP12.phx.gbl...
> Thanks, but I was doing the equivelent of this anyway. However, in a strange
> quirk of fate I stumbled on a solution. It would appear that if you set the
[quoted text clipped - 34 lines]
> >
> > TIA
Actually, the problem is something else completely. I found that my template
somehow had gotten a value in the title field, and if this happen, setting
the Title Field Programatically does not affect the documents content value.
I cleared this and re-ran it, it would seem to work fine. However, from an
academic point of view I would like to know
1.) Why this happens
2.) How to change what appears in the document content tab in the properties
dialog.
Hope you can help, I hate things I dont understand !

Signature
OHM ( Terry Burns ) * Use the following to email me *
Dim ch() As Char = "ufssz/cvsotAhsfbuTpmvujpotXjui/OFU".ToCharArray()
For i As Int32 = 0 To ch.Length - 1
ch(i) = Convert.ToChar(Convert.ToInt16(ch(i)) - 1)
Next
Process.Start("mailto:" & New String(ch))
--
Hmm.... I found that both methods work for me, BUT, I did find what seems to
me to be a bug in Word:
When the Title (probably applies to other properties, too) is set, then the
document must be saved for the change to apply. Changing a Document
Property apparently does not set the document state to dirty, so it is not
automatically saved upon closing.
So, using .Value will work, as will your method, you just have to explicitly
save the document.
hth,
-Peter
> Thanks, but I was doing the equivelent of this anyway. However, in a
> strange
[quoted text clipped - 37 lines]
> >
> > TIA
Peter - 24 Dec 2004 00:44 GMT
The problem is not the title of the template, it's just that you need to explicitly save the document after changing the title.
Simply invoking ActiveDocument.Save isn't enough, since changing the title doesn't make the document "dirty" so .Save does nothing. Before invoking ActiveDocument.Save, invoke ActiveDocument.Saved = False in order to force the document to save. Why changing the title doesn't "dirty" the document beats me.
I put the following sub in the ThisDocument module of a template, then created a document based on it. It changed the title of the document every time (after the initial creation, naturally).
Private Sub Document_Open()
Dim sTitle As String
If ActiveDocument.Type = wdTypeDocument Then
sTitle = ActiveDocument.BuiltInDocumentProperties("Title").Value
MsgBox "Old Title: " & sTitle
On Error Resume Next
sTitle = CStr(CInt(sTitle) + 1)
If Err Then
sTitle = "0"
End If
On Error GoTo 0
MsgBox "New Title: " & sTitle
ActiveDocument.BuiltInDocumentProperties("Title").Value = sTitle
ActiveDocument.Saved = False
ActiveDocument.Save
End If
End Sub
hth,
-Peter
"OHM ( Terry Burns )" <me@mine.com> wrote in message news:eAdhexS6EHA.824@TK2MSFTNGP11.phx.gbl...
> Actually, the problem is something else completely. I found that my template
> somehow had gotten a value in the title field, and if this happen, setting
[quoted text clipped - 65 lines]
> > >
> > > TIA