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
232 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 16

Accepted Solution

by:
kmslogic earned 500 total points
ID: 38827905
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
ID: 38827919
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
ID: 38827990
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

Enroll in July's Course of the Month

July's Course of the Month is now available! Enroll to learn HTML5 and prepare for certification. It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Authors who set out to write any sort of lengthy piece for online submission—be it a long question or comment on a technical form, an article, or a substantial blog entry—often find it useful to work up a draft in an editor other t…
A few years ago I was very much a beginner at VBA, and that very much remains the case today.  I'll do my best to explain things as I go in the hope that other beginners can follow.  If you just want to check out a tool that creates a Select Case fu…
In this video, we show how to convert an image-only PDF file into a PDF Searchable Image file, that is, a file with both the image (typically from scanning) and text, which is created in an automated fashion with Optical Character Recognition (OCR) …
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …

624 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