Forum Home
Press F1
 
Thread ID: 67317 2006-03-24 05:04:00 Word macro will not work FoxyMX (5) Press F1
Post ID Timestamp Content User
440333 2006-03-24 05:04:00 I am trying to add an old macro to Word XP/2002 for formatting email text (ie it removes all the > marks and wonky line spacing) but it is not working . Can anyone see what the problem is please? Below are the instructions that I have been following to create the macro:



Word 6 and 7

Macro Creation Instructions

Select the macro text below, between the Sub Main and End Sub lines and copy it to the clipboard by pressing <Ctrl>-C
Select Tools, Macro,
Type fixmail in the Macro Name field of the Macro dialog box, and click Create .
Press <Ctrl>-V to paste the macro text into the macro .
Select File, Close and click Yes when prompted to save the changes in the macro .


Sub MAIN

dowhat = 1
If SelType() = 2 Then
dowhat = 0
End If

EditReplace . Find = "^p", . Replace = "@@@", . Direction = 0, . ReplaceAll, . Wrap = dowhat
EditReplace . Find = "@@@@@@", . Replace = "^p^p", . Direction = 0, . ReplaceAll, . Wrap = dowhat
EditReplace . Find = "@@@", . Replace = " ", . Direction = 0, . ReplaceAll, . Wrap = dowhat

End Sub



Thanks . :)
FoxyMX (5)
440334 2006-03-24 05:59:00 The problem is that those old commands are no longer valid because the code is now using Visual Basic for Applications not Word Basic. If your in the VB Editor and select the help topic "Visual Basic Equivalents for WordBasic Commands" it describes what the new equivalents are.

I'll see if I can work it out for you - Im not sure what ^P is representing etc so I would need to understand that.
Parry (5696)
440335 2006-03-24 06:22:00 Found some code which seems to be just a recorded macro so is a lot longer that it needs to be but see if it does the job.
www.livinginternet.com

The first line Application.Move Left:=342, Top:=7 will cause an error and is crap anyway so remove that line.

hth
Parry (5696)
440336 2006-03-24 06:25:00 Thanks Parry but don't go to any trouble trying to get it to work as it isn't that important - I can always install my older version of Word if I want to .

I was just wondering whether there may have been a quick fix somewhere as I didn't realise that things had changed a lot .

Thanks anyway . :)


Edit: Oops, didn't see your latest reply until after I posted . I will check that out later on and let you know how it goes . Thanks . :)
FoxyMX (5)
1