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
228 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When creating Microsoft Word-based forms there may be a need to have a form field repeated throughout the whole document. For instance, with a company name, you may want this information repeated automatically throughout the document rather than man…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
This video walks the viewer through the process of creating an MLA formatted document, as well as a bibliography with citations.
This video walks the viewer through the process of creating Hyperlinks for the web and other documents. Select the "Insert" tab: Click "Hyperlink":  Type "http://" followed by a web address to reference a website or navigate to a document to ref…

738 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