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 / July 2005

Tip: Looking for answers? Try searching our database.

Macro Font

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lilbit - 15 Jul 2005 16:20 GMT
Is it possible to format(font, size, color) a single word in a macro?
Jean-Guy Marcil - 15 Jul 2005 16:37 GMT
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

Signature

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org

Lilbit - 15 Jul 2005 16:58 GMT
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.
Jonathan West - 15 Jul 2005 17:17 GMT
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.

Signature

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

> 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.
Lilbit - 15 Jul 2005 18:46 GMT
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!!
Lilbit - 15 Jul 2005 18:49 GMT
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.
Jean-Guy Marcil - 15 Jul 2005 19:34 GMT
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.

Signature

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org

Lilbit - 15 Jul 2005 19:50 GMT
Thanks!!
Jonathan West - 18 Jul 2005 10:49 GMT
> Thanks!!

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.

Signature

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 

Lilbit - 15 Jul 2005 16:58 GMT
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.
 
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.