Solved

Macros for MS-WORD

Posted on 1999-01-18
6
199 Views
Last Modified: 2010-05-03
My problem is like the following.

I want to write a macro for the File Menu - SaveAs menu item.The code will take every character from the word document and convert it to ascci value of thew character+128(for each character).

1.How can I write the macro???
2.How to read and convert each character in the word document to ascii(character)+128.

3.Please give me the code, as I am ignorant about macros.

Thanking u in anticipation,
Baidehish
0
Comment
Question by:bdwibedy
6 Comments
 
LVL 69

Expert Comment

by:Éric Moreau
ID: 1469332
Why not simply add a password on your document?

Converting each character (surely possible but I don't know how) can be a heavy job!!!
0
 
LVL 4

Expert Comment

by:mcix
ID: 1469333
Something like this...

Public Sub ConvertToAsciiPlus128()

    Dim mintCurrentChar As Integer
    Dim mintCurrentAsASCII As Integer

    For mintCurrentChar = 1 To ActiveDocument.Characters.Count
        mintCurrentAsASCII = Asc(ActiveDocument.Characters(mintCurrentChar)) + 128
        MsgBox mintCurrentAsASCII
    Next

End Sub

0
 

Accepted Solution

by:
rbcampacci earned 100 total points
ID: 1469334
Something like this...

Public Sub ConvertToAsciiPlus128()

    Dim mintCurrentChar As Integer
    Dim mintCurrentAsASCII As Integer

    For mintCurrentChar = 1 To ActiveDocument.Characters.Count
        mintCurrentAsASCII = Asc(ActiveDocument.Characters(mintCurrentChar)) + 128
        MsgBox mintCurrentAsASCII
    Next

End Sub
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:bdwibedy
ID: 1469335
Thank you
0
 
LVL 4

Expert Comment

by:mcix
ID: 1469336
Is it me, or did rbcampacci copy my comment and submit it as an answer?
0
 

Expert Comment

by:rbcampacci
ID: 1469337
ok, mcix!!! sorry!!! but don´t forget to send a ANSWER in the next time that you read a question!!!

Thanks!!!

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now