<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://planeshift.top-ix.org//pswiki/index.php?action=history&amp;feed=atom&amp;title=Astyle_msvc</id>
	<title>Astyle msvc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://planeshift.top-ix.org//pswiki/index.php?action=history&amp;feed=atom&amp;title=Astyle_msvc"/>
	<link rel="alternate" type="text/html" href="https://planeshift.top-ix.org//pswiki/index.php?title=Astyle_msvc&amp;action=history"/>
	<updated>2026-04-06T21:59:25Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://planeshift.top-ix.org//pswiki/index.php?title=Astyle_msvc&amp;diff=19143&amp;oldid=prev</id>
		<title>Talad: Created page with &quot;Add a macro in Visual Studio with the following content. Change the fileName and shellCmd paths.    &lt;nowiki&gt;     Public Sub formatDocWithAStyle()         Dim fileName As Strin...&quot;</title>
		<link rel="alternate" type="text/html" href="https://planeshift.top-ix.org//pswiki/index.php?title=Astyle_msvc&amp;diff=19143&amp;oldid=prev"/>
		<updated>2013-09-22T19:27:07Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;Add a macro in Visual Studio with the following content. Change the fileName and shellCmd paths.    &amp;lt;nowiki&amp;gt;     Public Sub formatDocWithAStyle()         Dim fileName As Strin...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Add a macro in Visual Studio with the following content. Change the fileName and shellCmd paths.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&lt;br /&gt;
    Public Sub formatDocWithAStyle()&lt;br /&gt;
        Dim fileName As String&lt;br /&gt;
        Dim textDocument As TextDocument&lt;br /&gt;
        Dim startPoint As EnvDTE.EditPoint&lt;br /&gt;
        Dim endPoint As EnvDTE.EditPoint&lt;br /&gt;
        Dim text As String&lt;br /&gt;
        Dim shellCmd As String&lt;br /&gt;
        Dim procId As Integer&lt;br /&gt;
        If DTE.ActiveDocument Is Nothing Then&lt;br /&gt;
            Return&lt;br /&gt;
        End If&lt;br /&gt;
        fileName = &amp;quot;c:\temp\formattedCode&amp;quot;&lt;br /&gt;
        shellCmd = &amp;quot;&amp;quot;&amp;quot;D:\Program Files\AStyle\bin\AStyle&amp;quot; &amp;amp; &amp;quot;&amp;quot;&amp;quot;&amp;quot; &amp;amp; &amp;quot; --style=allman --align-reference=name --align-pointer=type --indent-switches --unpad-paren &amp;quot; &amp;amp; &amp;quot;&amp;quot;&amp;quot;&amp;quot; &amp;amp; fileName &amp;amp; &amp;quot;&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        textDocument = DTE.ActiveDocument.Object&lt;br /&gt;
        startPoint = textDocument.StartPoint.CreateEditPoint&lt;br /&gt;
        endPoint = textDocument.EndPoint.CreateEditPoint&lt;br /&gt;
        text = startPoint.GetText(endPoint)&lt;br /&gt;
        My.Computer.FileSystem.WriteAllText(fileName, text, False)&lt;br /&gt;
        procId = Shell(shellCmd, AppWinStyle.Hide, True, 30000)&lt;br /&gt;
        If procId = 0 Then&lt;br /&gt;
            text = My.Computer.FileSystem.ReadAllText(fileName)&lt;br /&gt;
            startPoint.ReplaceText(endPoint, text, vsEPReplaceTextOptions.vsEPReplaceTextTabsSpaces)&lt;br /&gt;
        End If&lt;br /&gt;
    End Sub&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Talad</name></author>
	</entry>
</feed>