Corby111

I knew there was a reason I was looking at VSTO, I have a C# Windows App, and I am showing the user a Word doc using the DsoFramer control for viewing and editing.

All this works fine, what I would like to know how to do (and I do not know if an AddIn or a WordProject is my best bet) is how do you create a "Post It Note" type control allowing the editor of the document to "Add Post It Note" , and also veiw other comments that were previously created. (preferably in a yellow balloon or box like a "Post It Note"). A super plush would be a way to toggle "View Comments - turn them all on if they are there - and Hide Comments - make them all invisible if there are any.

Another plus (or point to note) is I will need the ability to programatically add notes and update text in the note.

Thank you in advance, please keep in mind I am using C#, not VB.Net if you can.

Corby Nichols

Houston, Texas




Re: Visual Studio Tools for Office Post It Note Type Comments Control In Word Document

Cindy Meister

Hi Corby

There's nothing in VSTO that adds this kind of functionality to Word.

To pursue how to use the built-in Comments capabilities, you should ask in either the word.general.vba newsgroup (that's where you'll get the broadest discussion about what the object model can do) or the office.developer.automation newsgroup (where people can "talk" C#). Links to both these newsgroups, and more, can be found in the "Please Read First" posting at the top of the forum.






Re: Visual Studio Tools for Office Post It Note Type Comments Control In Word Document

Corby111

I have read the Read this First, and every article about Word I can find on C#, and after 3 days

I created a pretty cool wrapper control to the DsoFramer, and I can do alot of stuff with the control.

As for creating a PostIt Note type comment, I will read about Words Comment abilities this weekend, and I am sorry if I

am ignorant about what Word can and can not do, but when with you think like a computer (as one of my bosses used to put it) you

can usually do anything. Are you telling me Word doesnt have any drawing abilities, I havent researched yet, but I

thought with all the charting it can do, there should be some drawing controls. If I can draw a rectangle

and add text to it, that is all I need. A plus would be if there is a control similiar to a panel in Word to let the

drawn rectangle "Float" on it, but if I can paint it I can simulate drag and drop I think. If it isnt possible, which may be the case, but arent there ways to override the paint events like I used to do in Visual Basic 6 (ages ago) Sorry if this is off topic, but you are the only expert on Word I have encountered in all msdn forums that responds to my questions.

Thank you,

Corby Nichols






Re: Visual Studio Tools for Office Post It Note Type Comments Control In Word Document

Cindy Meister

Hi Corby

"Thanks for the flowers ". You'll also find me in the office.developer and the word.vba newsgroups listed in "Please Read First". I wouldn't send you there, otherwise - that's actually more where I "live". It's a fine line a moderator walks: trying to keep a forum on-topic and at the same time provide people with information...

To give you a quick answer: Word doesn't expose a lot of events and isn't very "generous" about letting the Windows API "do its thing" in a Word document window. You can draw rectangles, but making them behave like comments (display only when the mouse hovers) won't be possible - no mouse events. No drag-and-drop events, either, I'm sorry to report. No "panels" you can float. No paint events you can override...

Besides comments, the closest thing we do in Word is to place a textbox or a frame in the margin, next to the text ("marginals" in documentation-speak) that are anchored and formatted to move with the text. They can be pretty cool, actually, as they can be defined as a style. Then you can type text in its own paragraph, apply the style, and the whole thing positions itself quite nicely.






Re: Visual Studio Tools for Office Post It Note Type Comments Control In Word Document

Corby C#

I dont need the note to be hidden, and only show on mouseover I really need the note all the time, so a drawn rectanle with a text box would work fine. I will go buy book at lunch about Word, and stop bugging you. Are you paid by Microsoft to answer questions

Thanks,

Corby





Re: Visual Studio Tools for Office Post It Note Type Comments Control In Word Document

Cindy Meister

Hi Corby

Not sure you'll find a book at the level you require... The Word newsgroups really are an excellent resource for "getting outside the box" - lots of bright people who enjoy helping others do "the unexpected". I don't feel bugged (I enjoy helping you); just concerned about keeping things pigeon-holed properly :-)

No, I don't get paid by Microsoft, although I do get official recognition (the "MVP" under my name). It's very interesting, learning about what people want to do with the programs. I learn a lot while helping. And I occasionally pick up some consulting work along the way...






Re: Visual Studio Tools for Office Post It Note Type Comments Control In Word Document

Corby111

Yeah I didnt really find any books on what I want to do.

I think since I have Word hosted in a control now, I will just create a Margin Panel and allow notes to be "Tagged" in the document.

Is there a way that you know of to get the x, y (mainly the Y) coordinate of where a piece of text occurs in a document relative

to the left edge of the doc I know how to get to the text I want by finding a range, just not sure how to know

where that range is in the actual doc.

By the way, have you ever heard any feedback from Microsoft if Word (Office) is always going to remain a Com application,

will Microsoft ever start using Managed code as we are supposed to in the .Net world. just curious, if they are ever going to

rewrite it from scratch.

Thanks,

Corby Nichols






Re: Visual Studio Tools for Office Post It Note Type Comments Control In Word Document

Corby111

I just wante to close this with one last post, I have used Word as an application since Office 95, and I thought I new word, I had never used comments in Word until today. You do learn something new every day (I know more about Word then I ever wanted to now actually) but Insert >> Comment was hidden to me for all these years unless it is an Office 2003 feature (I doubt it).

I will post this in office.VBA group you mentioned, but can the comments be attached to programmatically
If yes, they are exaclty what I need.

Thanks for all your help Cindy, I was over complicating something simple, that is why we have job security I guess.

Corby






Re: Visual Studio Tools for Office Post It Note Type Comments Control In Word Document

Cindy Meister

Hi Corby

Didn't see anything from you in a newsgroup, yet, so I'm just doing a quick follow-up, here... Yes, I've worked with Word since version 2.0 and I'm always amazed at what I didn't know, when someone comes up with something "new" <g>

If, with your last question, you mean can they be automated: Yes. Start with the old stand-by of recording a macro, then use that to get you into the Help topics :-)

<<Is there a way that you know of to get the x, y (mainly the Y) coordinate of where a piece of text occurs in a document relative to the left edge of the doc I know how to get to the text I want by finding a range, just not sure how to know where that range is in the actual doc.>>

Take a look at the Range.Information property. But if the "box" should move with the text, as it's edited, it's better to make sure to set the Anchor property and set the vertical position relative to the paragraph.

<<By the way, have you ever heard any feedback from Microsoft if Word (Office) is always going to remain a Com application, will Microsoft ever start using Managed code as we are supposed to in the .Net world. just curious, if they are ever going to rewrite it from scratch.>>

I'm not sure they even know if this is going to happen :-) Certain is: VBA will be supported at the very least through the next version. Perhaps longer. I think (just my personal logic) it will also depend, to an extent, on whether the operating system remains COM. Re-writing an app as complex as Word, without removing any of the functionality, would be a horrendous undertaking and extremely (prohibitively ) expensive. Backwards compatibility at the automation level is also very important. Observing the development of the application is almost like watching a good "who-done-it" :-)