Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / July 2005

Tip: Looking for answers? Try searching our database.

Can't save new Title Property

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rob Diamant - 11 Jul 2005 15:41 GMT
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
Helmut Weber - 11 Jul 2005 16:54 GMT
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"
Rob Diamant - 11 Jul 2005 19:19 GMT
Thanks, but it did not work. Any other suggestions?

Rob

> Hi Rob,
>
[quoted text clipped - 10 lines]
> Win XP, Office 2003
> "red.sys" & Chr$(64) & "t-online.de"
Jonathan West - 12 Jul 2005 16:11 GMT
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

Signature

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

> Can someone please point me in the correct direction. I am using Word 2003
> and have the following code to set the Title property:
[quoted text clipped - 14 lines]
>
> Rob
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.