Archived

This topic is now archived and is closed to further replies.

foofightr

converting VS 6 macros to .NET

Recommended Posts

Well, they don''t just plug right in. That would be too easy. There''s this commenting macro that I used a lot in VS 6, so I want to use it in VS.NET. I fixed all the syntax errors as best I could (by adding "Dim" before every variable, and changing ActiveDocument.Selection to ActiveDocument.Selection.Text) but it''s giving a runtime error now. Cast from type ''TextSelection'' to type ''String'' is not valid. This is probably due to the ActiveDocument lines, but I''m not a VB coder and I can''t find any info on migrating macros from 6 to .NET. Anyone have a good link to a site that outlines common issues when migrating macros to .NET? Google can''t find anything useful, and a search on these forums yielded nothing.

Share this post


Link to post
Share on other sites
First of all the macros are written in visual basic .net, so you should convert them to that first. Secondly the other differences are listed in msdn

I don''t know any tool to convert automatically, so unfortunately you have to do it manually

Share this post


Link to post
Share on other sites