I don't know how to convert the following VBA code to AHK.
VBA code:
Code: Select all
Sub Makro1()
If Not CommandBars.GetPressedMso("SelectionPane") Then CommandBars.ExecuteMso ("SelectionPane")
End Sub
Code: Select all
oWord := ComObjActive("Word.Application")
if (oWord.CommandBars.GetPressedMso("Selection and Visibility"))
{
}
else
{
oWord.CommandBars.ExecuteMso("Selection and Visibility")
}
oWord := "" ; Clear global COM objects when done with them
Code: Select all
Error: 0x80070057 - Parameter is not correct
Source: (null)
Description: (null)
HelpFile: (null)
HelpContext: 0
Specifically: GetPressedMso
Code: Select all
oWord.CommandBars.GetPressedMso("Selection and Visibility")
What am I doing wrong?
Link to docs.microsoft.com (shorted due to forum security reason):
//docs.microsoft.com/pl-pl/office/vba/api/office.commandbars.getpressedmso
Kind regards, mslonik