Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / February 2005

Tip: Looking for answers? Try searching our database.

Containing Hidden Data in a .doc Document

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David - 09 Feb 2005 13:40 GMT
Hello,

I have a word document with a drop down form field. I also have a table
cell with a paragraph of text in. I am writing a macro to make the
paragraph of text change depending on what is selected in the drop down
box.

I can write a macro to cause the table text to change however I need to
have somewhere to put all the paragraphs of text that aren't currently
visible on the document where they can be referred to when needed. I
want everything to be inside the one .doc file and I don't want to embed
the paragraphs into the VBA code.

Is there a 'proper' way to do this, a way to contain data (possibly a
large amount) in a form that a macro can refer to, that regular user
won't see?

Is is possible to somehow have entire pages with formatting, tables,
images etc hidden from regular users (if not always at least when the
form is in protected mode)?

Cheers,

David
Doug Robbins - 10 Feb 2005 00:55 GMT
Here's an example that shows how you can insert an autotext entry
corresponding to an item selected in a drop down formfield:

' Macro created 15-11-97 by Doug Robbins to add the address corresponding to
a drop down name

Dim Company as String, Address as String

Set myDrop = ActiveDocument.FormFields("Dropdown1").DropDown

Company = myDrop.ListEntries(myDrop.Value).Name

Address = ActiveDocument.AttachedTemplate.AutoTextEntries(Company).Value

ActiveDocument.FormFields("Text1").Result = Address

Signature

Please respond to the Newsgroup for the benefit of others who may be
interested.   Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP

> Hello,
>
[quoted text clipped - 20 lines]
>
> David
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.