Hi, folks,
I’ve been using this macro to make my editing conventions list since 2004 (I got it fro the Editorium.)
Sub GetThat2() Selection.Copy WordBasic.NextWindow Selection.PasteAndFormat (wdPasteDefault) Selection.TypeParagraph WordBasic.NextWindow Selection.MoveRight Unit:=wdCharacter, Count:=1 End Sub
Today, my client did not allow me to load my macros onto its computer. So I recorded a macro like this:
Sub GetTerm2()
‘
‘ GetTerm2 Macro
‘
‘
Application.Run MacroName:=”Editing.WordMacros.EditCopy”
Windows(“conventions doc”).Activate
Selection.PasteAndFormat (wdPasteDefault)
Selection.TypeParagraph
Windows(“Main doc”).Activate
Selection.MoveRight Unit:=wdCharacter, Count:=1
End Sub
I don’t want the file names in the code because the macros needs to work on many different files–like the old one does. I tried replacing the Windows….Activate lines with “ActiveWindow.Next.Activate” and “ActiveWindow.Previous.Activate” (which I found on a VBA code snippets site), but the resulting macro doesn’t work. I haven’t put”WordBasic.NextWindow” in there because I know from experience that Word Basic commands sometimes cause Word to hang and it’s pretty clear that MS is moving away from them. Can someone tell me how to fix the code, tell me how to keep the macro recorder form putting in file names, or take pity on me and give me working code?
Cheers