about macro

  • Thread starter Thread starter Tony Johansson
  • Start date Start date
T

Tony Johansson

Hello!

Creating a very very simple macro which is just a carriage return in code
doesn't work.
I start recording and then press the return key and then press the stop
recording macro.
So now I have a temporary macro which I run by select run Tempreary Macro
but nothing happens.
So is there some kind of bug in the usage of Macro.
I have a visual studio C# project.

Can anybody explain why my simple macro doesn't work.

//Tony
 
Tony Johansson said:
Creating a very very simple macro which is just a carriage return in code
doesn't work.
I start recording and then press the return key and then press the stop
recording macro.
So now I have a temporary macro which I run by select run Tempreary Macro
but nothing happens.
So is there some kind of bug in the usage of Macro.
I have a visual studio C# project.

Can anybody explain why my simple macro doesn't work.

No, because I followed your instructions and it worked just fine. Which
version of Visual Studio are you using? The macro only works if the focus
is in the editor window for a source file. Are you trying to do something
"tricky" here?
 
Tony Johansson said:
Creating a very very simple macro which is just a carriage return in code
doesn't work.
I start recording and then press the return key and then press the stop
recording macro.
So now I have a temporary macro which I run by select run Tempreary Macro
but nothing happens.
So is there some kind of bug in the usage of Macro.
I have a visual studio C# project.

Can anybody explain why my simple macro doesn't work.

No, because I followed your instructions and it worked just fine. Which
version of Visual Studio are you using? The macro only works if the focus
is in the editor window for a source file. Are you trying to do something
"tricky" here?
 
Hello!

I have VS2005.
So in Macro Explorer I have a file called TemporaryMacro located in
RecordingModule.
Below you can see how it look like. So if I double click on this
TemporaryMacro nothing happens.
It's the same result if I click on Tools->Macros->Run TemporaryMacro nothing
happens.
I 'm not trying to anything special just figure out how macros work by
trying an extremely simple example.

Option Strict Off
Option Explicit Off
Imports System
Imports EnvDTE
Imports EnvDTE80
Imports System.Diagnostics
Public Module RecordingModule
Sub TemporaryMacro()
DTE.ActiveDocument.Selection.NewLine(2)
End Sub
End Module


Here is my C# Program
using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApplication20
{
class Program
{
static void Main(string[] args)
{
}
}
}

Does anyone have an idea why my macro doeasn't work?

//Tony
 
Hello!

I have VS2005.
So in Macro Explorer I have a file called TemporaryMacro located in
RecordingModule.
Below you can see how it look like. So if I double click on this
TemporaryMacro nothing happens.
It's the same result if I click on Tools->Macros->Run TemporaryMacro nothing
happens.
I 'm not trying to anything special just figure out how macros work by
trying an extremely simple example.

Option Strict Off
Option Explicit Off
Imports System
Imports EnvDTE
Imports EnvDTE80
Imports System.Diagnostics
Public Module RecordingModule
Sub TemporaryMacro()
DTE.ActiveDocument.Selection.NewLine(2)
End Sub
End Module


Here is my C# Program
using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApplication20
{
class Program
{
static void Main(string[] args)
{
}
}
}

Does anyone have an idea why my macro doeasn't work?

//Tony
 
Hello!

This was a knows bug se below. I had install SP1 for VS05 and now it works.

When you use Microsoft Visual Studio 2005 on a system that has an updated
version of the Microsoft .NET Framework 2.0 installed, you cannot run a
macro in the Visual Studio Macros IDE. When this problem occurs, you do not
receive an error message, and the macro does not run.

The problem is caused by a recent design change to the common language
runtime (CLR) components for the .NET Framework 2.0. This change may cause
compatibility issues for the design-time engine of Microsoft Visual Studio
for Applications. Visual Studio 2005 uses the design-time engine of Visual
Studio for Applications for macro capabilities. These compatibility issues
may prevent the macro script from being compiled successfully or from being
loaded successfully. Therefore, the macro does not run.

//Tony


Tony Johansson said:
Hello!

I have VS2005.
So in Macro Explorer I have a file called TemporaryMacro located in
RecordingModule.
Below you can see how it look like. So if I double click on this
TemporaryMacro nothing happens.
It's the same result if I click on Tools->Macros->Run TemporaryMacro
nothing happens.
I 'm not trying to anything special just figure out how macros work by
trying an extremely simple example.

Option Strict Off
Option Explicit Off
Imports System
Imports EnvDTE
Imports EnvDTE80
Imports System.Diagnostics
Public Module RecordingModule
Sub TemporaryMacro()
DTE.ActiveDocument.Selection.NewLine(2)
End Sub
End Module


Here is my C# Program
using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApplication20
{
class Program
{
static void Main(string[] args)
{
}
}
}

Does anyone have an idea why my macro doeasn't work?

//Tony
 
Hello!

This was a knows bug se below. I had install SP1 for VS05 and now it works.

When you use Microsoft Visual Studio 2005 on a system that has an updated
version of the Microsoft .NET Framework 2.0 installed, you cannot run a
macro in the Visual Studio Macros IDE. When this problem occurs, you do not
receive an error message, and the macro does not run.

The problem is caused by a recent design change to the common language
runtime (CLR) components for the .NET Framework 2.0. This change may cause
compatibility issues for the design-time engine of Microsoft Visual Studio
for Applications. Visual Studio 2005 uses the design-time engine of Visual
Studio for Applications for macro capabilities. These compatibility issues
may prevent the macro script from being compiled successfully or from being
loaded successfully. Therefore, the macro does not run.

//Tony


Tony Johansson said:
Hello!

I have VS2005.
So in Macro Explorer I have a file called TemporaryMacro located in
RecordingModule.
Below you can see how it look like. So if I double click on this
TemporaryMacro nothing happens.
It's the same result if I click on Tools->Macros->Run TemporaryMacro
nothing happens.
I 'm not trying to anything special just figure out how macros work by
trying an extremely simple example.

Option Strict Off
Option Explicit Off
Imports System
Imports EnvDTE
Imports EnvDTE80
Imports System.Diagnostics
Public Module RecordingModule
Sub TemporaryMacro()
DTE.ActiveDocument.Selection.NewLine(2)
End Sub
End Module


Here is my C# Program
using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApplication20
{
class Program
{
static void Main(string[] args)
{
}
}
}

Does anyone have an idea why my macro doeasn't work?

//Tony
 
Back
Top