Containing Hidden Data in a .doc Document

D

David

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
 
D

Doug Robbins

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


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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top