Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #7  
Old 08-04-2014, 05:54 AM
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

This is the code.

Code:
Sub SetProperties()
'
' Set key document properties
'
Dim Rng As Range
With ActiveDocument
    '
    ' Category property
    .BuiltInDocumentProperties("category") = "Generic Template"
    '
    ' Title property
    Set Rng = .Tables(1).Cell(2, 2).Range
    Rng.End = Rng.End - 1
    .BuiltInDocumentProperties("title") = Rng.Text
    '
    ' Subject property
    Set Rng = .Tables(1).Cell(4, 2).Range
    Rng.End = Rng.End - 1
    .BuiltInDocumentProperties("subject") = Rng.Text
    '
    ' Author property
    Set Rng = .Tables(1).Cell(9, 2).Range
    Rng.End = Rng.End - 1
    .BuiltInDocumentProperties("author") = Rng.Text
    '
    ' Manager property
    Set Rng = .Tables(1).Cell(10, 2).Range
    Rng.End = Rng.End - 1
    .BuiltInDocumentProperties("manager") = Rng.Text
    '
    ' Save document - macro will be mapped to CTRL+S
    .Save
End With
 End Sub
Images of the table and document properties are attached.
Attached Images
File Type: png DocInfoTable.png (20.3 KB, 26 views)
File Type: png DocProperties.png (30.4 KB, 24 views)
Reply With Quote
 

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 11:43 PM.


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