Word Document Replace Text and save to a new file [closed] - c#

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I've seen a few topics over the web of how to replace text in a Word Document, but my real question is the following: Is Interop the best option? Is there any other (better) option?
Here is an example of a topic I've read LINK.
I'm trying to arrange something that will work great on a Web Server, so I'm asking too if you guys could provide some code to get me started.
Thanks!

This is a very difficult question to answer since it involves that much opinions about which is best, in any definition of best.
As a starter I would definitely go for VSTO / interop since it is easier to go, and is integrated with and maintained by the developer of both products (Office and Visual Studio).
If your require it to run on a server (with ASP.NET for example) you should NEVER use VSTO / interop.
Why?
This is what Microsoft says about it.
Office interop is not built to run on a server as a process. It is too heavy, and depends on the UI capabilities for rendering, etc. You could use Open XML for Word or EPPlus for Excel for example.

Related

How do I convert a ColdFusion website to a .NET website? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
This may be too broad, but I have a huge ColdFusion website that I am being tasked to rebuild in .NET. I've heard that you have to build .NET websites using Visual Studio and it's all set up in that environment, but I would like to keep everything (CSS, HTML, Javascript, etc.) except the Coldfusion. Can I just copy the pages over to a .NET server and replace the Coldfusion commands with C# commands or something? Is it not that easy?
You should look at this in the same way one would translate Chinese text to English. It's not word for word, but you have to understand what is being said to rewrite it in another language.
No, it is not as easy as replacing commands. Converting without rewriting would be a bad idea. First, get immersed in the site and learn everything it does. Then, design the new site to use the old code if it is modular. Convert it piece by piece until you are done.

Which is better option OpenXml or Microsft.Office.Interop.Excel to read excel file in c#? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
I am using .NET 4.6 framework and I have to read multi sheets predefined templated excel workbook in asp.net/c# code and I know two way to solve the problem using either DocumentFormat.OpenXml.dll or Microsoft.Office.Interop.Excel.dll assembly.
But I am in confusion which one to use as I don't have expert knowledge to decide.
My questions are;
What are the pros and cons using them in a solution?
Is there one better than another?
Could you please explain so that I could pick one?
The answer is relatively simple: If you combine "excel file" and "asp.net" in the same sentence, NEVER use Interop.
Interop opens a real excel instance and manipulates it to set / retrieve data.
It's slow, can hang unpredictably, there might be popups which block your program (are you sure you want to overwrite this file?) and it's a resource hog.
DocumentFormat.OpenXml.dll works, but it's complex to work with, especially if you have user supplied data sheets, which you want to manipulate.
Third party libraries like EPPLUS are more high level and user-friendly, so I would recommend such library.

can i write an Autosave plugin for microsoft windows notepad? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I use notepad for writing daily notes.some times when system gets restarted by accidentally, I loose my content.
So my question is"can I write an auto-save plugin for notepad" ?
Please let me know if I can write an auto-save plugin for Notepad using C#.NET.
I know about Notepad++ but I want to use notepad only.
Thanks in Advance.
There is no direct way of doing this because NotePad is a separate application and you don't have its code. Even if you did have the code, I'm highly sure it wouldn't be in a .NET-based language.
There is an alternate though. You could recreate entire NotePad from scratch in .NET. Believe me it won't take more than a couple hours for a guy who knows his tools (someone out there might already have done that). Then you can add any new features at your choice.
Yet another way would be hooking into NotePad's low-level messages through Platform calls and trying to somehow inject your features into it, but that's something I'm not an expert at and that would probably take more effort/expertise than writing your own NotePad from scratch.

What is the best way to learn a new library written in C# using Visual Studio 2010 [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I recently found the need to learn a new library that didn't come with extensive documentation for a change. The code is written in C# and I am using Visual Studio 2010 as my editor. The library that I am trying to learn did come with a sample driver, but it is fairly large and complex as well. I was wondering if there are any facilities in VS that would allow me to watch the code as it is executing so that I learn as it runs.
Is anyone aware of any tools that I should be looking at in VS and additionally, in general can you specify any other methods that I might use to quickly learn how to use new libraries.
Thanks
Write learning tests.
Red Gate's Reflector is a must have for looking into 3rd party library's and there are a couple plugins for it (FileDisassembler is one) that allow you to save your dissasembled files so that you can step through the code.
You can set a BreakPoint at any line you you want the program to stop at, and when you run it in debug mode, you will then be able to execute a single line of code at a time, by pressing F11 or F10 (F10 does not go deeper into inner function calls).

How to document an application or code [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I have to document a small piece of code (a game), and document the known steps of software engineering (analyze, design, implement, etc...). How can I do it in the code (Visual C#)?
Use standard documentation markup for C#. Here is a good article explaining how this is accomplished. Your "analyze & design & implementation" comments could go right above your classes along with sample code. You could then download a tool such as NDoc or SandCastle, which will read your assembly documentation markup and generate nice and easily readable documentation.
I would use standard documentation markup, generating output using Sandcastle Help File Builder, which is a great GUI wrapper (and then some) around the Sandcastle project.

Categories