Plz Anyone Convert this VB code to C# Equivalent

G

goraya

Hi
Plz Anyone Convert this VB code to C# Equivalent
Here Application is MS Word.
With Application
.Visible = True
.Activate
.COMAddIns.Item("NETSLogin.CNetsWord").Connect = True
.Run
MacroName:="NETSTemplate.NWCommands.LoginToNETS"
.Run MacroName:="NETSTemplate.md.OpenDocForNETSSite"
End With
Thank u for ur help in Advance.Plz help ASAP.
With bers regards
Qumer
 
C

Cindy M -WordMVP-

Hi Goraya,
Plz Anyone Convert this VB code to C# Equivalent
Here Application is MS Word.
With Application
.Visible = True
.Activate
.COMAddIns.Item("NETSLogin.CNetsWord").Connect = True
.Run
MacroName:="NETSTemplate.NWCommands.LoginToNETS"
.Run MacroName:="NETSTemplate.md.OpenDocForNETSSite"
End With
Hmmm. These groups are actually here to help you learn to solve your
own problems. So, IMO, you need to put in some effort, then ask for
help to solve the parts you just can't figure out. This should get you
started:

How is it not working for you, as it stands? Can't recall having ever
seen With...End With used in C#, so you need to precede each of the
code lines with Application. And put a ; at the end of each of them.
Then, C# doesn't recognize named arguments, so you have to remove the
parameter names, such as MacroName:=

Once you do all that, then try to run it, what does the Debug tell you
is wrong?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top