|
There isn't a predefined solution for this, but it can be done with .NET. First you have to have access to stuff from MS Word, such as Recent files as suggested below by Colin. If you have access to events and stuff from Word it can be easily done.
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
alina_anitei wrote: detect the name
"detect"? what does that mean?
alina_anitei wrote: I just want to know if vsto can
What does the Documentation say?
|
|
|
|
|
it means to find the word document path that i've just created
|
|
|
|
|
alina_anitei wrote: it means to find the word document path that i've just created
And is there nothing in the documentation that tells you how to get at the MRU (Most Recently Used) file list? (I don't know much about the capabilities of Office 2007 integration with .NET, so I'm just trying to get you looking in the right direction so you might be able to see what's there)
|
|
|
|
|
Thanks a lot Colin. I used your advice and i solved my problem.
Here's the code:
using Office = Microsoft.Office.Core;
using Word = Microsoft.Office.Interop.Word;
public void OnTextButton(Office.IRibbonControl control)
{
Word.Range currentRange = Globals.ThisAddIn.Application.Selection.Range;
Microsoft.Office.Interop.Word.Window activeWin = (Microsoft.Office.Interop.Word.Window)control.Context;
if (activeWin.Application.ActiveDocument.Path =="")
{
MessageBox.Show("You didn't save the document.");
return;
}
else
{
currentRange.Text = "Path: " + activeWin.Application.ActiveDocument.Path +
"\r\n" + "Name: " + activeWin.Application.ActiveDocument.Name;
}
}
This works on Office 2007 and returns the name of the current document.
Thanks again!
|
|
|
|
|
alina_anitei wrote: that i've just created
Post that code
|
|
|
|
|
I can poste the add-in code for office 2007. It's ok?
|
|
|
|
|
alina_anitei wrote: I can poste the add-in code for office 2007. It's ok?
Well, just the relevant bits. There is nothing wrong with posting code, it is actively encouraged. Just don't go nuts and post everything.
|
|
|
|
|
i learn c#.i want to be best programmer.i want to your help.please send sample
|
|
|
|
|
lankaudaranga wrote: please send sample
You'd better send me a sterilised sample bottle first then. It might be a little warm by the time it gets to you.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Pete O`Hanlon wrote: You'd better send me a sterilised sample bottle first then
You beat me to it. I left the page languish for too long as I attended something else before putting in my smart-alec answer.
|
|
|
|
|
Colin Angus Mackay wrote: before putting in my smart-alec answer.
He seems suspiciously Kylesque
|
|
|
|
|
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
lankaudaranga wrote: i learn c#.i want to be best programmer.i want to your help.please send sample
Go buy a couple books on OOP, and C#. Additionally, learn to title your posts properly.
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
lankaudaranga wrote: please send sample
Okay - I'll just nip down to my local doctor's office to get a sample container and if you send me your address I'll get it sent to you. Goodness only knows what customs will think of it, especially with a biohazard logo on it.
|
|
|
|
|
OK - yours was worded better than mine.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Both are very funny.
You don't have to use the real stuff, you could just warm up some apple juice in the microwave
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
I don't know if you've picked up on the humour yet, but if not I should explain that it is at your expense.
You have blustered onto this forum. Marked every post so far with the name of the forum, which does in no way help those who would like to help you. Then you've given very short statements/questions with no information and, I can only assume, you then expect an answer.
lankaudaranga wrote: i want to be best programmer
You have a long long way to go first. As others have advised you need to get yourself some books. You then need to sit down and read them, understand them and learn from them.
lankaudaranga wrote: i want to your help
Then you might want to read these guidlines[^] on how to get help on a forum. It would seem that the natural thing to do is to study the etiquette of a situation before blustering in on it.
lankaudaranga wrote: please send sample
A sample of C#:
public class Program
{
public static void Main()
{
Console.WriteLine("Hello World");
}
}
|
|
|
|
|
I quite honestly don't understand people's lack of motivation. Sure, I have asked questions before, but they have always been very specific. Additionally, I have always used up all available resouces such as CP Articles, MSDN, google, etc. I don't have a degree, and have been a teacher to myself. When I see this types of questions, it is definatley a WTF moment for me. Maybe it's an India thing...
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
Justin Perez wrote: When I see this types of questions, it is definatley a WTF moment for me
It has gone way past WTF moments for me. I will still moan and bitch about it on my blog (which I'd link to if the server wasn't currently waterlogged and awaiting replacement - later this week hopefully) and I have a good few posts about it when the situation really gets me down.
Justin Perez wrote: Maybe it's an India thing...
Not exclusively, but there are an increasing number of people from India making this type of post which does make it look like they are lazy workshy slackers who want everyone to do their work. But you've also got to look around and see how many Indians are on this site helping out too - those numbers are also increasing.
Some of it does appear to be cultural. I once stopped by a McDonalds in Edinburgh on my way home. It was about 23:30 and they were winding down for the night (they shut at midnight). I went through the drive-thru and as I wasn't caring what I ate (I was just hungry and had a one-hour drive ahead of me) I asked what was available now.
The Indian chap at the window persuaded me that he would personally make me what ever I wanted from the menu as all the remaining food that was already prepared was going stale and I wouldn't want it. He took my order and made a small mistake when typing it into the till - nothing serious he'd just doubled up the entry for something, he realised it and called his colleague over to help correct it.
Now, instead of allowing his colleague to come over and talk him through the correction he tried to dash off to make my burger. His colleague, who, by the looks of it, had been through this many times with him, called him back to learn. He stood there watching the process of correcting the double entry as if he was bursting for the toilet. As soon as the entry was corrected he dashed off again, leaving his colleague to collect the money from me and issue my change.
When I drove upto the next windows I could see the Indian guy dash maddly round parts of the kitchen putting everything together. He eventually, and very proudly, presented me with my meal - but I couldn't help thinking that if he'd just done his job and let everyone else do their job it would have arrived a lot faster (remember I told him at the start I was in a hurry) and he wouldn't have irritated his colleagues who were trying to help and show him how to correct his mistakes.
|
|
|
|
|
I have noticed that at all fast food place, regardless of race. They take customer service and politeness to the extreme, where it actually becomes counter-productive. I'd like to read your blog, shoot me a link to it when your server isn't water-laden.
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
public class PlzHlp
{
public static void Main()
{
Console.WriteLine("Help needed - URGENT!");
}
}
I'll leave you to learn about nice indentation.
I still remember having to write your own code in FORTRAN rather than be a cut and paste merchant being pampered by colour coded Intellisense - ahh proper programming - those were the days
|
|
|
|
|
All you do is post general question that if you bought a book or used this thing called GOOGLE you could learn. Now stop bothering us!
_____________________________________________
Flea Market! It's just like...it's just like...A MINI-MALL!
|
|
|
|
|
Do you know any nice free simple Chart Control for .NET 2005
|
|
|
|
|
There are some articles that go over creating charting and graphing libraries on this site. Have you searched the articles?
|
|
|
|