Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-12-2015, 10:15 PM
IanDB IanDB is offline Using document shelf (I think that was name) Windows 8 Using document shelf (I think that was name) Office 2003
Novice
Using document shelf (I think that was name)
 
Join Date: Sep 2015
Posts: 3
IanDB is on a distinguished road
Default Using document shelf (I think that was name)

Hi
Way back, maybe in Word 2002, there was a VBA command which would write/read data to a hidden part of the document, not properties but some hidden area only available via VBA. I have a recollection it was called "document shelf"
I used it quite regularly, but I have totally forgotten the VBA code to write/read to this area.


Can anyone remember what the calling code was and maybe whether it is still available in Word 2013.
Any help much appreciated

Ian B
Reply With Quote
  #2  
Old 09-12-2015, 10:32 PM
macropod's Avatar
macropod macropod is offline Using document shelf (I think that was name) Windows 7 64bit Using document shelf (I think that was name) Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You may be thinking of document variables, which can only be accessed by macros or read by fields. Document properties are another possibility, but there are ways for users to see and update those without resorting to either VBA or reading them with fields. Either way, though, fields can't update document variables or properties. And yes, both are supported in Word 2013.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 09-12-2015, 10:43 PM
IanDB IanDB is offline Using document shelf (I think that was name) Windows 8 Using document shelf (I think that was name) Office 2003
Novice
Using document shelf (I think that was name)
 
Join Date: Sep 2015
Posts: 3
IanDB is on a distinguished road
Default

Thanks Paul
Thats it, it all comes back to me now.
Thanks again for your prompt and accurate response

Cheers

Ian B
Reply With Quote
  #4  
Old 09-13-2015, 01:09 AM
macropod's Avatar
macropod macropod is offline Using document shelf (I think that was name) Windows 7 64bit Using document shelf (I think that was name) Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You can add/query document Variables quite easily with VBA. For example:
Code:
Sub Demo()
With ActiveDocument.Variables
  If .Item("MyVar") Is Nothing Then .Add Name:="MyVar", Value:="MyVal"
  MsgBox .Item("MyVar").Value
End With
End Sub
You can then use a DOCVARIABLE field in the document to retrieve its value.

Word's custom document properties are about as easy to work with, but built-in document properties require less work, since you always know they'll be there. Both kinds can also be viewed via File>Info>Properties and can be referenced in the document via a DOCPROPERTY field.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Using document shelf (I think that was name) split word document based on bookmarks with each new document title of the bookmark megatronixs Word VBA 9 09-05-2020 02:29 PM
How to save active document to SharePoint document library Rose roon Word VBA 9 09-22-2015 10:53 PM
document styles and some formatting doesn't appear where should when different people view document Dilbert fan Word 1 08-23-2015 05:07 AM
Using document shelf (I think that was name) Run-time error '1004': Document not saved. The document may be open... doctor_who12 Excel Programming 1 01-22-2014 04:47 PM
Using document shelf (I think that was name) How do I see one document map for each half of a split MS WORD 2010 document? quickwin Word 3 07-09-2013 10:20 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:26 PM.


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