T
Tom_OM
I'm working on a Word add-in that will need to save some simple
information and retrieve it later. There will be a small number of
records, probably no more than ten, and each record will have just two
bits of information: a record number and a string. That's it. This
add-in's needs are way too basic to be using extensive ADO or DAO data
controls, linking them to an Access file or whatever.
I've created pseudo databases before in regular VB 6 by using either
sequential access or random access files. I would have no trouble in
creating a pseudo-database using these technologies. However, each
PDB is for its own Word document. In other words, every PDB is
information about a specific Word document, and only that document
alone. If I used sequential access or random access files, I could
simply name the text file after its corresponding Word file. Example:
Janis.doc has a PDB file named Janis.dat. Just one problem. If the
user changes a document's name, the ActiveDocument.Name command can no
longer be used to find the PDB file. Also, there's the danger that a
user could find the PDB file and mess with it.
I'd much rather save the PDB info in the Word document itself in a way
that the user cannot see. It's going to be a very small amount of
data and therefore shouldn't add much to a file's size. I noticed in
the VBA IDE under "Normal" there's something called MyDocument. Is
this a property that every Word file has? Can I save the info in
there somehow? I did a keyword search of the vba news group's
archives for this, but didn't find anythings.
I'm used to VB 6 (and RB '06) and am still kind of getting my feet wet
with VBA. Oh, and the version I'm using is Word XP ('02). I'm
grateful for any help offered.
information and retrieve it later. There will be a small number of
records, probably no more than ten, and each record will have just two
bits of information: a record number and a string. That's it. This
add-in's needs are way too basic to be using extensive ADO or DAO data
controls, linking them to an Access file or whatever.
I've created pseudo databases before in regular VB 6 by using either
sequential access or random access files. I would have no trouble in
creating a pseudo-database using these technologies. However, each
PDB is for its own Word document. In other words, every PDB is
information about a specific Word document, and only that document
alone. If I used sequential access or random access files, I could
simply name the text file after its corresponding Word file. Example:
Janis.doc has a PDB file named Janis.dat. Just one problem. If the
user changes a document's name, the ActiveDocument.Name command can no
longer be used to find the PDB file. Also, there's the danger that a
user could find the PDB file and mess with it.
I'd much rather save the PDB info in the Word document itself in a way
that the user cannot see. It's going to be a very small amount of
data and therefore shouldn't add much to a file's size. I noticed in
the VBA IDE under "Normal" there's something called MyDocument. Is
this a property that every Word file has? Can I save the info in
there somehow? I did a keyword search of the vba news group's
archives for this, but didn't find anythings.
I'm used to VB 6 (and RB '06) and am still kind of getting my feet wet
with VBA. Oh, and the version I'm using is Word XP ('02). I'm
grateful for any help offered.