#1
|
|||
|
|||
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 |
#2
|
||||
|
||||
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] |
#3
|
|||
|
|||
Thanks Paul
Thats it, it all comes back to me now. Thanks again for your prompt and accurate response Cheers Ian B |
#4
|
||||
|
||||
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 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] |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
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 |
Run-time error '1004': Document not saved. The document may be open... | doctor_who12 | Excel Programming | 1 | 01-22-2014 04:47 PM |
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 |