Can't save new Title Property

R

Rob Diamant

Can someone please point me in the correct direction. I am using Word 2003
and have the following code to set the Title property:

WordObject.ActiveDocument.SaveAs Filename:=rs.Fields(1) & "-" &
rs.Fields(2) & ".doc"
WordObject.ActiveDocument.BuiltInDocumentProperties(wdPropertyTitle) =
"Converted Activity"
WordObject.ActiveDocument.BuiltInDocumentProperties(wdPropertyAuthor) =
"Data Conversion"
WordObject.ActiveDocument.Save
WordObject.ActiveDocument.Close

When I review the results, the Author is correct but the Title is the first
sentance from the document.

Any suggestions will be greatly appreciated.

Rob
 
H

Helmut Weber

Hi Rob,

at a long shot:

WordObject.ActiveDocument.Saved = false
before
WordObject.ActiveDocument.Save


Greetings from Bavaria, Germany

Helmut Weber, MVP, WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 
J

Jonathan West

Hi Rob

Change the order in which you do things, as follows

WordObject.ActiveDocument.BuiltInDocumentProperties(wdPropertyTitle) =
"Converted Activity"
WordObject.ActiveDocument.BuiltInDocumentProperties(wdPropertyAuthor) =
"Data Conversion"
WordObject.ActiveDocument.SaveAs Filename:=rs.Fields(1) & "-" &
rs.Fields(2) & ".doc"
WordObject.ActiveDocument.Close


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top