Storing large amounts of (hidden) data within a single word document?

K

KR

Hi all- thanks in advance for your help; using Word97 on Win98SE...

I'm looking for the best way to store this large amounts of information
(essentially several manually-built flat file database tables) in a word
document without it being accessable to the user; I remember reading (but
can't find) a post talking about this subject, and I think Custom
DocProperties were the suggested solution... however, in my tests, the
document properties (including custom ones) are available to any user via
the document property interface, which is undesirable for me.

Does anyone have other ideas on how to handle this? Can I suppress the
custom docproperties information from showing in the user interface? What
about (noting: Word97/ Win98SE) saving the information in some sort of low
level encryption to avoid the property 'value' from being read, even if the
user looks at the property dialog? Essentially I need to store data (away
from user's eyes) without putting the data in the document or in a separate
file.

I am thinking that maybe I could do this by writing the data in XML format
(using whatever XML command is available for encryption?) and that might
also make it easier to work with the data, but I haven't messed with XML
yet, so I'll wait to hear if that is possible/desirable in Word97 before I
start a whole new learning curve...

Many thanks,
Keith
 
C

Chad DeMeyer

KR,

I'm not sure about the feasibility of XML for this since I have no
experience so far with XML, but one alternative to document properties is
document variables. They can only be created and modified with VBA, and the
only way the users can even discover their values, apart from using VBA,
would be to insert DOCVARIABLE fields, and they would have to know the name
of the variable to insert the field.

Regards,
Chad
 
K

KR

One additional clarification (specifically in case it affects an XML
solution)- I am working with the lowest common denominator of users, so I
definitely need a "one file deployment" and not ask users to install
add-ins, other files, libraries, etc- all I can deliver is my one word file
(a template) and have them use that to create their working documents. If it
isn't readily available in Win98SE/Word97, then I either have to be able to
activate it in code (if it is there, but just not linked) or else live
without it...
 
K

KR

I'll definitely look into document variables; an initial read of the VBA
help file (on my work PC which has Word 2000) doesn't provide any
information about limitations such as total number of variables, maximum
size of fields, etc... does anyone know where I could find that information
to help me decide whether this method can support my needs?

Many thanks,
Keith
 
J

Jezebel

Maximum length of a DocVariable is 65280 characters. On my computer I was
able to add 3955 variables each of that length, before I got an error --
whether that's a Word limit or a function of my computer's memory, I don't
know. However, if you have anything remotely like this quantity of data, why
not put it in a separate MDB file?

A quick way to work with data packed into string variables is using the
Join() and Split() functions.
 
P

Peter Hewett

Hi Jezebel

Join and split are not available in Word 97 :(

I believe they were introduced with Office 2000.

Cheers - Peter


Maximum length of a DocVariable is 65280 characters. On my computer I was
able to add 3955 variables each of that length, before I got an error --
whether that's a Word limit or a function of my computer's memory, I don't
know. However, if you have anything remotely like this quantity of data, why
not put it in a separate MDB file?

A quick way to work with data packed into string variables is using the
Join() and Split() functions.

HTH + Cheers - Peter
 
J

Jezebel

That's a bugger.


Peter Hewett said:
Hi Jezebel

Join and split are not available in Word 97 :(

I believe they were introduced with Office 2000.

Cheers - Peter




HTH + Cheers - Peter
 
W

Word Heretic

G'day "Jezebel" <[email protected]>,

The one that threw me was Replace() ... when the hell did that come
in? That is one damn useful routine. Mind you, when it came in I
deleted like 6 lines of code that did the same thing, but STILL!!!


Steve Hudson - Word Heretic
Want a hyperlinked index? S/W R&D? See WordHeretic.com

steve from wordheretic.com (Email replies require payment)


Jezebel reckoned:
 
P

Peter Hewett

Hi Word Heretic

It came in Office 2000 along with Spliff and Joint!

Cheers - Peter


G'day "Jezebel" <[email protected]>,

The one that threw me was Replace() ... when the hell did that come
in? That is one damn useful routine. Mind you, when it came in I
deleted like 6 lines of code that did the same thing, but STILL!!!


Steve Hudson - Word Heretic
Want a hyperlinked index? S/W R&D? See WordHeretic.com

steve from wordheretic.com (Email replies require payment)


Jezebel reckoned:

HTH + Cheers - Peter
 
W

Word Heretic

G'day Peter Hewett <[email protected]>,

I found a tiny bug in Replace() the other day, had a double slashed
filename and triedf to replace "\\" with "\". Failed miserably.

Steve Hudson - Word Heretic
Want a hyperlinked index? S/W R&D? See WordHeretic.com

steve from wordheretic.com (Email replies require payment)


Peter Hewett reckoned:
 
K

KR

Unfortunately, I have non-computer-friendly users who will be using my
template, so I have to make installation and use as easy as possible,
including the possibility that they may want to work on their document on
multiple computers. I figured keeping everything in one file would be the
easiest solution- even if I used VBA to create an mdb file (for example,
on_open) the data still wouldn't be available if they decided to work on the
file on a different PC unless I include even more complex code to "package"
everything any time they wanted to move to a new PC...
:-(
 
K

KR

I think that my data will fall within three areas;
(1) the actual text that is entered into the document, (no worries)
(2) a lot of source information (text) that I could hardcode into a module
(more on this later)
(3) my summary information, that will only be created and updated based on
#1, above

I think that as long as I use different docvariables for different tasks,
I'll be ok with the speed- for example, one part of the program will be
helping the user schedule a group of up to 10 people (reviewers) with an
unknown number of people in 30 minute intervals over 5 days- it will all be
userform based, but I'll need to store who is meeting with whom, and when,
so I can rebuild the userform anytime and allow users to make changes. Of
course, I'd rather mix-and match programs, but I need to roll everything out
in one file for these users.

As for #2 above, I will have the source data in Excel (after parsing what is
important out of a different file) and so one of my challenges will be
searching old posts to figure out how to dynamically update an existing
module's code, as this source data will change annually and I don't want to
have to re-code it all in VBA each year.

Thanks,
Keith
 
W

Word Heretic

G'day "Jezebel" <[email protected]>,

Plain and simple, I had a variable with a filename like C:\\My
Documents\\Some Path\\SomeFile.Doc and it simple wouldn't remove the
double slashes. Annoying. In this case it was easier to not
double-slash under certain circumstances.

Steve Hudson - Word Heretic
Want a hyperlinked index? S/W R&D? See WordHeretic.com

steve from wordheretic.com (Email replies require payment)


Jezebel reckoned:
 
J

Jezebel

Steve, there must be more to it, or there's a VBA version issue somewhere.
From my immediate window:

? replace("C:\\My Documents\\Some Path\\SomeFile.Doc", "\\", "\")
C:\My Documents\Some Path\SomeFile.Doc
 
W

Word Heretic

G'day "Jezebel" <[email protected]>,

The only thing I can think of is a dozen or so lines above I do the
Replace() with the opp settings (eg \,\\). It certainly threw me. I
even set a break point and manually did it from the immediate window
with identical results.

I have used it to reduce before, so dunno what is happening this time.
If I just enter 'your' provided line in the immediate window (without
executing the problem code), it works as advertised.

So it pretty well has to be the previous invocation doing something
strange.

Steve Hudson - Word Heretic
Want a hyperlinked index? S/W R&D? See WordHeretic.com

steve from wordheretic.com (Email replies require payment)


Jezebel reckoned:
 
M

macropod

Hi KR,

Just in case you're still thinking of using DocVariables, keep in mind that
they, and anything else in an unprotected document can easily be seen by
opening it in Notepad ...

You could hide pretty much any amount of text you like in a (protected) vba
module.

Cheers
 
J

Jean-Guy Marcil

Bonjour,

Dans son message, < macropod > écrivait :
In this message, < macropod > wrote:

|| Hi KR,
||
|| Just in case you're still thinking of using DocVariables, keep in mind
that
|| they, and anything else in an unprotected document can easily be seen by
|| opening it in Notepad ...
||
|| You could hide pretty much any amount of text you like in a (protected)
vba
|| module.

But if security is a serious issue, keep in mind that a protected VB module
is very easy to crack.

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
M

macropod

Hi Jean-Guy Marcil,

I think cracking the protection on vba modules would be far beyond most
users' abilities!

Cheers
 
J

Jean-Guy Marcil

Bonjour,

Dans son message, < macropod > écrivait :
In this message, < macropod > wrote:

|| Hi Jean-Guy Marcil,
||
|| I think cracking the protection on vba modules would be far beyond most
|| users' abilities!
||

You are right... For a basic protection from prying eyes, it would be OK

But it is up to each user's level of determination... not abilities. I mean,
with Google, PtoP sharing and an afternoon on your hand, even if you know
nothing about cracking, it can easily be done.
It is not like some other type of cracking that actually require knowledge
and/or a prior understanding of cryptography...

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top