TechnologyDoctor
asked on
F6 Find and Highlight Macro
Upgraded a computer from Windows 7/MSOffice 2013 to Windows 10/Office 365, and yes I checked with the vendor for compatibility issues. However, unknown to me, there was a MSWord macro in use that would find a * placeholder in the real estate closing documents so that they could be easily moved to and highlighted by pressing F6. This would allow the user to move to the correct spot, input the correct data and delete the placeholder *, with a single key stroke. I have a copy of the macro, but it will not work in Office 365, it just launches the new Find and Replace function in Office 365. Does anyone have an idea? Old macro below.
Sub F6()
'
' F6 Macro
'
'
Selection.Find.ClearFormat ting
With Selection.Find
.Text = "*"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
End Sub
Sub F6()
'
' F6 Macro
'
'
Selection.Find.ClearFormat
With Selection.Find
.Text = "*"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
End Sub
Make sure that the code in question is in a regular module
Add this macro to the Thisdocument module in the VBA window, save the document, CLOSE it and then reopen it.
Private Sub Document_Open()
With Application
.CustomizationContext = ThisDocument
.KeyBindings.Add KeyCode:=BuildKeyCode(wdKe yF6), _
KeyCategory:=wdKeyCategory Command, _
Command:="F6"
End With
End Sub
Add this macro to the Thisdocument module in the VBA window, save the document, CLOSE it and then reopen it.
Private Sub Document_Open()
With Application
.CustomizationContext = ThisDocument
.KeyBindings.Add KeyCode:=BuildKeyCode(wdKe
KeyCategory:=wdKeyCategory
Command:="F6"
End With
End Sub
ASKER
Word downloaded to the desktop. Thank you for your time and consideration.
ASKER
Syed, Would the solution have to be added each time a document was created by the closing software or one time to the normal.dot template?
Try adding it to the Thisdocument module of the "Normal" file.
ASKER
Syed, I am either not understanding your instructions or they are not working for me. I created a macro with a Thisdocument name and copied and pasted your text and saved into the normal file. When I attempt to get the F6 function to run, all I get are highlighed symbols at the top of my screen, not even in the word document.
F6-Error.jpg
F6-Error.jpg
This question needs an answer!
Become an EE member today
7 DAY FREE TRIALMembers can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
If Word is anything like Excel, the online version does not allow macros.