Solved

Macros for MS-WORD

Posted on 1999-01-18
6
210 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 70

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
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

777 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