Solved

Macros for MS-WORD

Posted on 1999-01-18
6
221 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…

861 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