Solved

Is there a way to store data not meant to be printed only accesed by vba macros in a word document

Posted on 2013-01-28
3
192 Views
Last Modified: 2013-01-28
I have many word documents that connect to  sqlite databases is it possible to store the database path somewher in the document where it is not visible to the user that a vba macro can read to connect to the database?
0
Comment
Question by:Dov_B
  • 2
3 Comments
 
LVL 16

Accepted Solution

by:
kmslogic earned 500 total points
Comment Utility
Yes, you can use document variables in VBA:

ActiveDocument.Variables.Add Name:="MyComments", Value:="This is some stuff that gets stored with the document."

Open in new window


Then you can retrieve it with

ActiveDocument.Variables("MyComments").Value

Open in new window

0
 

Author Comment

by:Dov_B
Comment Utility
Thanx a kazillion!
how much text can be stored in a document variable?
Is it possible to stor an sqlite database file in a document variable?
0
 
LVL 16

Expert Comment

by:kmslogic
Comment Utility
It looks like the limitation is 65k characters for a single variable in Word 2013 (not sure about earlier versions).  So embedding a sqllite database might be challenging but perhaps not impossible if you use many variables to hold the values and then reconstruct it in VBA.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Like many others, we try and discourage users from printing documents unnecessarily and instead send or share them electronically. However, this doesn't always work and documents are still printed. With this simple solution, if the user tries to …
Nice table. Huge mess. Maybe this was something you created way back before you figured out tabs or a document you received from someone else. Either way, using the spacebar to separate the columns resulted in a mess. Trying to convert text to t…
This video walks the viewer through the process of creating envelopes and labels, with multiple names and addresses. Navigate to the “Start Mail Merge” button in the Mailings tab: Follow the step-by-step process until asked to find the address doc…
Office 365 is currently available in five editions. Three of them are for business use: Office 365 Business Essentials, Office 365 Business, and Office 365 Business Premium. Two of them are for home/personal use: Office 365 Home and Office 365 Perso…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now