[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

11/04/2009 at 07:35AM PST, ID: 24871156
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.3

How do I pass a string from VBA macro to .NET project when I'm using SHELL command to open the project.

Asked by capsoftuk in Microsoft Development, Microsoft Office Suite, VB Script

Hi there,

I'm currently working on a project which requires me to open a .NET project from a button on a toolbar in a word document. However, I need to pass the filepath of the RTF that is being used to the .NET project and I'm struggling a little to figure out how. I'm using the SHELL command to launch my .NET executable, but I was wondering if there was any way to pass arguments to the .NET runtime which I could then pick up and use - basically I'm trying to set something up whereby I select some text from the .NET project, and it then inserts it at the cursor's location in Word.

So basically I need a way of passing the filepath of the RTF through to the project so that the project, using the Word Interop Assembly, can grab the relevant ActiveDocument and then insert some text into the document. Here's what I've got so far:

* attached code snippet *

Please let me know if you have any ideas or suggestions. I'll keep googling for now.

Cheers

Andy
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
Sub testing() 
Dim path
path = ActiveDocument.path + "\" + ActiveDocument.Name
MsgBox (path) 
Dim RetVal 
RetVal = Shell("C:\Documents and Settings\AndrewSeaton\My Documents\WORK\VSProjects\ClauseLibrary\ClauseLibrary\bin\Debug\ClauseLibrary.exe", 1) 
'tried
'RetVal = Shell("C:\Documents and Settings\AndrewSeaton\My 'Documents\WORK\VSProjects\ClauseLibrary\ClauseLibrary '\bin\Debug\ClauseLibrary.exe" & path, 1)
'with no luck - it thinks it's part of the file name. 
'Code to pick up the string on the program.cs file: 
static void Main(String[] args)
        {
            string s = "";
            if (args.Length > 0)
            {
                s = args[0]; 
            } 

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1(s));
        } 
End Sub
[+][-]11/04/09 07:57 AM, ID: 25740612

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Development, Microsoft Office Suite, VB Script
Sign Up Now!
Solution Provided By: GrahamSkan
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20090824-EE-VQP-74 - Hierarchy / EE_QW_3_20080625