Word VBA >> Unvisible Text / property

by Peter Lingo » Sun, 01 Aug 2004 07:06:45 GMT

Hello,

I have a vba application for word, in which it is nesessary to put
information (=text) in the document which is unvisible for the user. Is
there any property were this can be done?
thanks Peter




Word VBA >> Unvisible Text / property

by Stan Scott » Sun, 01 Aug 2004 09:53:50 GMT


Yes. If you do it from the document itself, you select the text, click
Format and then check the "Hidden" checkbox on the dialog. If you do it
from code, use Selection.Font.Hidden = True









Word VBA >> Unvisible Text / property

by Doug Robbins » Sun, 01 Aug 2004 10:11:25 GMT

Hi Peter,

The following will insert some text and format the font as hidden

Dim myrange As Range
Set myrange = Selection.Range
myrange.Text = "Some Text"
myrange.Font.Hidden = True

The user can easily see it however if they turn on the display of hidden
text. Using a DocumentVariable would allow you to save some text with the
document so that:

You could later retrieve if by

Using VBA
Inserting a DocVariable field

Even then however, all that the user would have to do is run the following
code to learn what the text is:

Dim avar As Variable
For Each avar In ActiveDocument.Variables
MsgBox avar.Value
Next avar

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






Unvisible Text / property

by peter.lingo » Mon, 02 Aug 2004 22:18:56 GMT






Can it make be sure that the user can't made the hidden text visible?
Even when the rest of document is editable completly
(format/content...)?

Thanks Peter


Unvisible Text / property

by Doug Robbins » Mon, 02 Aug 2004 23:34:13 GMT

If it's in the document, the user can read it.

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








Unvisible Text / property

by Chad DeMeyer » Tue, 03 Aug 2004 00:41:48 GMT

If you store the information in document variables, it will be accessible to
users but the average user doesn't know what they are or how to access them.
They can only be read by inserting a DOCVARIABLE field in the document or
using VBA.

Regards,
Chad








Unvisible Text / property

by peter.lingo » Wed, 04 Aug 2004 02:46:06 GMT






Thanks for the suggestions, DOCVARIABLE works like I want

Peter


Unvisible Text / property

by Chad DeMeyer » Wed, 04 Aug 2004 05:50:34 GMT

Glad to be of assistance
Regards,
Chad






accessible to
them.
or


Is




Unvisible Text / property

by peter.lingo » Mon, 09 Aug 2004 06:01:57 GMT










one further quetions

there is the method activedocument.variables.add
but why is not the activedocument.variables.remove method available?

thanks Peter


Similar Threads

1. make an access object unvisible with VBA

Hi,
how can I set an access object unvisible with VBA?
I habe access 2000

Thanks
TNL
.


2. Excel VBA: Worksheet cell .Text property: 1024 bytes text len limit - Excel

3. How To Set Text Property of Text object

hi all,

how can i set the text property programatically of a text box of crystal
report for dot net.
VB 6 syntax does not work here... any suggestion?


Thanks

Ansari



4. Setting properties of a property in the Property Grid - VB.Net

5. XL 97 Text Box property - WordWrap

Note: I also posted this thread in Excel Printing:

I'm running Windows 98, XL97 for a workbook with password protection at VBA 
ThisWorkbook level.  I have a text box contol embedded in a cell with max row 
height on cell set at 409.  Text box format control is set to 'move and size 
with cells' and PrintObject = True.  Properties for text box are also set to 
True for: EnterKeyBehavior, MultiLine, TabKeyBehavior, and WordWrap; False 
for: ScrollBarsBoth, AutoSize, DragBehavior, and SelectionMargin.

The problem is that when a user types text into the control and selects 
PrintPreview or actually prints the document, the data within the text box 
(if more than one line of text) does not wrap around properly.  Some of the 
text wraps, but cuts off other text that should have wrapped, as well.  Also, 
when the text box control = GotFocus, the text appears visually as it should 
look on PrintPreview or on Print command.

I have tried every combination for the text box control available.  I truly 
am at a loss here!  Is this something that has to be handled in VBA?  Thanks.

Please help!

6. Properties transferring from excel cells to word file properties - Excel

7. Changing text font and other properties

How can I change the text font and other properties through the SetProperty method?

I have this code:

oActiveDoc.AttachDispatch(oWord.get_ActiveDocument());
Selection oSel;
oSel.AttachDispatch(oWord.get_Selection());
oSel.InsertAfter("Example text.");
oSel.SetProperty(DISPID dwDispID,VARTYPE vt); <-----------

Is there any specification about the properties and about office sdk in general?

Thanks in advance.

8. TaskItem properties in Outlook.View XML property