Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have one blank document say 'A' and one skeleton document say 'B'. In document B i added my custom header and footer for example: Footer contains one logo and address. And my requirement is during my document A generation, I need to copy the B's header and footer contents to the A's header and footer area. B's header and footer may contain the combination of text and image. How can I accomplish this using Microsoft.Office.Interop.Word. If any one need further clarification please let me know.
So finally i found the answer to my question. I am posting the code here so in future someone will benefit with this piece of code.
B.Sections[1].Headers[WdHeaderFooterIndex.wdHeaderFooterFirstPage].Range.CopyAsPicture();
A.Sections[1].Headers[WdHeaderFooterIndex.wdHeaderFooterFirstPage].Range.Paste();
B.Sections[1].Footers[WdHeaderFooterIndex.wdHeaderFooterFirstPage].Range.CopyAsPicture();
A.Sections[1].Footers[WdHeaderFooterIndex.wdHeaderFooterFirstPage].Range.Paste();
Related
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 6 years ago.
Improve this question
I have an aspx page that give an exam result. I would like to send copy of this page as an e-mail body. I did a lot of search about this situation but i can not find any solution.
To start with, you can't do like this. But instead, what you can do is load data in some DataTable and create HTML body of the email by looping through the rows of that DataTable.
What I intend to say is you create email body string from the results and send that to wherever you want to send it.
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 8 years ago.
Improve this question
I would like to edit a MS Word document (docx) from a headless Windows server, e.g. set some text bold. Is that possible with C#? It will be part of a web application:
user uploads document
server modifies document (e.g. sets some text bold)
users can download modified document
My question is to know which API to use to edit the Word document.
Maybe checkout the following MSDN link, which details how to apply a style to a paragraph in a Word document using the OpenXML API:
http://msdn.microsoft.com/en-us/library/office/cc850838(v=office.15).aspx?cs-save-lang=1&cs-lang=csharp#sampleCode
Thanks to #paul-zahra 's comment, I will use OpenXmlSDK.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I want to sum the column (i.e, price) in Crystal Report. I am using VS2012.
How to do that?
Please reply using images to make it understand better.
The easiest way is to
Right click on your number field and choose Insert/Summary.
Within the Insert Summary window you have the options to choose the
field to summarize, how to calculate the summary, and which section
to put the summary.
use sum(YourcolumnName) in expression.
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 8 years ago.
Improve this question
For my job i have to make many small projects that require to send different mails and set up some html. I usually make these forms in Winforms. Now at this moment whenever i need to fill my html I take the string replace some values and have functions that write hardcoded table rows.
To make my job a little easier I was wondering if it was possible to import the razor engine(not sure if it's the right word choice) in my winforms project and simply pass a model to a CSHTML file which returns me the HTML in a string so i can mail it to coworkers.
If this is possible, instructions on how to do it are welcome.
Kind Regards Roxas
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I was wondering if anyone knew how to add text to an existing pdf document using iTextSharp. I know this question has been asked before but I am trying to add a footer to certain pages in the bottom right hand corner of the document, none of the other posts have helped me and I cannot find any solid info on it elsewhere.
Adding a footer is done using PdfStamper and the GetOverContent() method. See TwoPasses.cs for an example. For more info on this example, please read chapter 6 of my book.
Note that the example assumes that the pages are of size A4 and that the lower-left corner has the coordinate x=0,y=0. You say you have found other answers (tell us where), but that they didn't help (tell us why not). A common mistake you may have found while searching for an answer is to make the wrong assumptions about the MediaBox and the CropBox of the existing PDFs. Unfortunately, you're not telling us what you've tried (and as a result you risk that your question will be closed).