Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-31-2014, 01:03 PM
Ted C Ted C is offline Automate document properties Windows XP Automate document properties Office 2007
Novice
Automate document properties
 
Join Date: Oct 2011
Posts: 18
Ted C is on a distinguished road
Default

Update the code. This does not crash.



Code:
Sub SetProperties()
'
' Set key document properties
'
    Set docInfoTable = ThisDocument.Tables(1)
    Set docTitleCell = docInfoTable.Cell(Row:=2, Column:=2)
    Set docSubjectCell = docInfoTable.Cell(Row:=4, Column:=2)
    Set docAuthorCell = docInfoTable.Cell(Row:=9, Column:=2)
    Set docManagerCell = docInfoTable.Cell(Row:=10, Column:=2)
  
    ThisDocument.BuiltInDocumentProperties("title") = docTitleCell.Range.Text
    ThisDocument.BuiltInDocumentProperties("subject") = docSubjectCell.Range.Text
    ThisDocument.BuiltInDocumentProperties("author") = docAuthorCell.Range.Text
    ThisDocument.BuiltInDocumentProperties("manager") = docManagerCell.Range.Text
    ThisDocument.BuiltInDocumentProperties("category") = "Generic Template"
'
' Save the document
'
    ActiveDocument.Save
'
' This macro replaces FileSave on the CTRL+s keyboard shortcut
'
End Sub
But the value for all of the document properties is coming from docTitleCell.
Reply With Quote
Reply

Tags
properties



Similar Threads
Thread Thread Starter Forum Replies Last Post
Automate document properties Help with Document Properties Prompt Macro KJJ Word VBA 14 11-10-2016 08:18 PM
Automate document properties Updating Document Properties without using advanced properties dialogue thedr9wningman Word VBA 3 01-20-2014 05:56 PM
Key shortcut to access document properties eroock Word 0 12-11-2012 10:54 AM
Automate document properties Add custom document properties into document NicBodkin Word 8 05-05-2011 09:09 AM
document properties issues charris1980 Word 0 04-29-2009 12:49 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:27 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft