Go Premium for a chance to win a PS4. Enter to Win

x
?
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
Medium Priority
?
239 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 2000 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Introduction This tutorial provides instructions on how to properly format your Word document using the inbuilt tools provided. The benefits of using these tools means your documents are more accessible and easily portable to other applications an…
This article describes how to use the Send to Mail Recipient command. The instructions apply generally to Office 2007 and later versions, but Microsoft® Word 2013 was used for the specific steps and figures.  What is Send to Mail Recipient? Send…
This video walks the viewer through the process of creating a watermark for their document, customizing it, and saving it for viewing/printing needs.
In a previous video Micro Tutorial here at Experts Exchange (http://www.experts-exchange.com/videos/1358/How-to-get-a-free-trial-of-Office-365-with-the-Office-2016-desktop-applications.html), I explained how to get a free, one-month trial of Office …
Suggested Courses
Course of the Month12 days, 5 hours left to enroll

916 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