Macro Font

J

Jean-Guy Marcil

Lilbit was telling us:
Lilbit nous racontait que :
Is it possible to format(font, size, color) a single word in a macro?

Yes.

With Selection.Words(1).Font
.Size = 32
.Name = "Arial"
.Color = wdColorBlue
End With

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
L

Lilbit

Thanks! I'll try that. I've been trying to get my password in my macro
appear indistinguishable. Now I know how to do it.
 
L

Lilbit

Thanks! I'll try that. I've been trying to get my password in my macro
appear indistinguishable. Now I know how to do it.
 
J

Jonathan West

Step back a moment and describe again what you are trying to achieve.

What Password?
Stored where?
Used for what purpose?

It just strikes me that if you are looking to hide your password for
instance by coloring it white, this is a very insecure approach.


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 
L

Lilbit

That's exactly what I'm trying to do. If there is a more secure solution
(other than involving VB6), please let me know. Thanks a whole lot!!
 
L

Lilbit

Oops! I forgot to answer your questions. The password is stored in a
spellcheck macro. The spell check macro unprotects the form, using the
password. When spell check is completed, the macro protects the form,
again, with the password.
 
J

Jean-Guy Marcil

Lilbit was telling us:
Lilbit nous racontait que :
Oops! I forgot to answer your questions. The password is stored in a
spellcheck macro. The spell check macro unprotects the form, using
the password. When spell check is completed, the macro protects the
form, again, with the password.

Try using document variables instead. They are better because they can be
created or modified only through VBA.

e.g:

Dim GetPassword As String

ActiveDocument.Variables("myvar").Value = "MyPassword"

GetPassword = ActiveDocument.Variables("myvar").Value

Make sure the variables exists before retrieving it or you will get an
error. See the online help for more info on document variables.

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
J

Jonathan West

Lilbit said:

In addition, since any document variable can be read by anybody who knows
how to write a short VBA macro, I would recommend that you try to obfuscate
the password in some fashion. It won't save you from anyone who has a
program to crack your VBA project password (you *have* applied a pssword to
your VBA code?), but will protect you against ordinary inquisitive users.


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 

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