Create/Edit a Word Document from Visual Studio 2010 - visual-studio-2010

I have a word document with bookmarks in where text needs to be programatically inserted.
i used to (in vba) open a copy of this document, insert the text, print it, and close it.
Now Ive moved to VS2010 I cant get the code right.
I have imported the Microsoft.Office.Interop namespace but thats kind of where my knowledge falls down.
I think once i can get going i can figure it out its just getting the app to open the template.
Their doesnt seem to be much documentation on this and i would think this would come up fairly often.
any help you guys can give would be appreciated

Related

Visual Studio 2013 Cant find how to create Data Table

When I created my database and tried to add table to tables folder there was no option available to add new table. How to do this, looked everywhere and can not find it, on MSDN it says that it should be right there.
I wonder is it a downloadable content? If so I don't see it in updates either. Kinda lost myself on this one, could you please help me or point into some direction?

Macro or add-in to help moving hard-coded strings into an MFC .rc file

I am working on internationalizing an old MFC project and I have many thousands of hard-coded strings to move into the string table. I'm looking for a macro, add-in, or some information on creating a macro, add-in, or wizard that would allow me to semi-automate the process. I would like to be able to highlight a string, right-click and select something like "move to resource" and have the string added to the string table for the project. Something customizable would be great such that I could edit the identifier created and have the tool replace the hard-coded string in the code with a look up function (that I provide the name of). I searched for a few days and can't find anything like this. Does anyone know of a tool already in existence, or can provide some info on what VS extensiblity classes I can use to write one? I am using VS2010.
Thanks.
Have you looked at http://www.lingobit.com/products/hardcoded_string_extraction.html ? This is the only product I know of that does this. It's a hairy problem because there are so many corner cases.

Why do my images break in Visual Studio when they have the word "order" in them?

I've been banging my head trying to find the cause of why my images weren't loading, heres my basic work flow.
create image in Photoshop CS5
export for web/device (PNG/GIF/JPG)
save to images folder
drag the images into visual studio with the
rest of them
Now I've been using this method for a very long time, and after returning from holidays I couldn't figure out why this wasn't working any more. When the page loads it shows the missing image icon. Firebug couldn't locate the image, CSS was not reading it neither would an <img> tag.
A LONG time later it turns out I found the root cause, my image was named "order_header_bg.png" if I dropped the word "order" from the title it appeared!
I can't figure out why its doing it, I can't find any docs on image naming conventions, so the only work around is not to include the word. Its not a problem but I'm more curious as to why is doesn't behave as expected. Is this unique to my environment?
Do you have any ad-blocking software installed on your machine? They can be rather aggressive about what they block.
I had a client who had Norton Ad Blocker installed and was reporting that she could not see the navigation on her site. Her particular problem was that she was running an advertising agency, and thus all of her links were deemed as spam.
To answer my own question: Its goosed.

Expanded/collapsed state not saved after closing file

In Visual Studio, you can expand and collapse code without using regions, for example in a code-behind page you can collapse methods, etc... And in an ASPX page you can collapse tags, tags, etc...
It's useful when you have a long page and you want to focus your development on a specific part. What's cool about it too is that you can close the file and reopen it and the state of the expanded/collapsed blocks is saved exactly as you left it.
Except in one instance. That state is not saved for tags in ASPX pages, where it would be most useful.
I know there are some good plugins out there for VS but I couldn't find one that addresses this issue.
Has anybody got a solution?
Before you mention custom controls, they are not always convenient or feasible when trying to keep a page short and I don't consider this a solution to this problem.
Looks like this issue will stay unresolved at this time.
I opened a bug report on Microsoft Connect, if this issue is important to you please vote it up!
https://connect.microsoft.com/VisualStudio/feedback/details/613221/expanded-collapsed-state-not-saved-after-closing-file

Visual studio highlights asp.net tags as hyperlinks

As you can see from the screenshot, vs2008 thinks asp tags are hyperlinks. I have reset all the settings on it but the issue is still there. I have tried on different projects and the same issue is present. I have moved the projects to another visual studio installation and problem has gone until I move them back.
Any one knows why this happens?
alt text http://img12.imageshack.us/img12/9033/20090531191305.png
http://img12.imageshack.us/img12/9033/20090531191305.png
Does it happen for tags without an asp: prefix.
e.g. Can you create a UserControl, and drag that in and give it a different tag prefix
<cc1:MyCustomControl />
If not, then it sounds like something has gotten set on your system that treats asp as a protocol :(
But to be honest, I'm at a complete loss as to why this might happen.
Must say it is strange. Although I am clueless, I will still try.
Are those real hyperlinks or just underlined text? If underlined text, then you can change the settings (since you have mentioned about resetting the setting, this won't work). If they are real hyperlinks, I am stumped.

Resources