I've run into a little problem. Im making an Outlook Add-in, where i can archive an email.
When an email contains html/xhtml etc it converts hyperlinks into HYPERLINK "url".
Example:
HYPERLINK "Company URL" 1 x Mexicano
HYPERLINK "Company URL" € 1,75
HYPERLINK "Company URL" 1 x Patat
HYPERLINK "Company URL" € 1,25
each line should be an clickable URL, but for some reason outlook doesnt give plain text but this instead...
So i want to strip my string from: HYPERLINK "any characters here"
Can someone help me with this?
You can use something like:
Regex regex = new Regex ("HYPERLINK \"(.*?)\"");
This will match Company URL in HYPERLINK "Company URL" 1 x Mexicano, if that's what you were looking for.
Related
I was trying to manipulate the html code of the subject line like that:
I am subject#001
But the subject line can not HTML. Is there any other way I can hyperlink a word in the subject line?
No, you cannot.
HTML markup in mail headers is not supported by any email specification. Therefore, no, you cannot hyperlink a word in the subject line.
You cannot, put if you put a link in the subject (starting with http:// or https://), Outlook will show it as a link.
I have a panel that gets a hyperlink added dynamiclly through C# with values from an sql database.
However some of the URLs are really long and quite uneccessary to display.
I have not found any good ways to hide/disable the url showing and replace it with text. I can not use normal <a href> as it handled server side.
EDIT added some of the code.
<asp:HyperLink ID="moduleHyperlink" runat="server"></asp:HyperLink>
now in C#
HyperLink hyp = createHyperlink(btn.link);
moduleHyperlink.Controls.Add(hyp);
This will display for the user the entire btn.link (url string) which might be really long and it looks messy on the webpage. I would rather have a text saying "External Link", which when clicked redirects the user to the url.
You can add Text property to show some valid link title instead of showing the URL.
HyperLink hyp = createHyperlink(btn.link);
hyp.Text = "YourTextForTheLink";
moduleHyperlink.Controls.Add(hyp);`
I am trying to add a footer to the page that shows the page number what looks like this
"Page 1 of 10" in Chinese using Rotativa HTML to PDF library.
This is set by the CustomSwitches attribute.
My code is like this
ViewAsPdf pdfView = new ViewAsPdf("Index", Model)
{
FileName = fileName,
PageOrientation = pageOrientation,
PageSize = Size.A4,
IsJavaScriptDisabled = isJavaScriptDisabled,
CustomSwitches = "--disable-external-links --disable-internal-links --footer-center \"Page [page] of [toPage]\" --footer-font-size 7"
};
This works great.
But if I change the text to Chinese it does not render the characters right
--footer-center \"第 [page] 页, 共 [toPage] 页\"
I understand the this CustomSwitches calls wkHtmltoPDF, but did not find anything there either. The html page that contains Chinese characters renders just fine.
The answer is that the custom switches are a command line argument for the WkhtmltoPDF.
In order to make it work you have to go to Control panel -> Region and language -> Administrative -> Change system locale... -> in this case I selected Chinese (Simplified, PRC)
(asp.net C# project)
I am trying to show contact info in my footer, I receive the info from the database, but in my administrator panel I have CKEditor which adds linebreaks. So, what my problem is that I'd like my text in my footer to have no linebreak, is there any way of doing this?
How it looks in my contact page:
Adresse
Zip, City
Phone
Fax
How I would like it to be in my footer:
Adresse, Zip city, phone, fax
I receive the texts using:
<p><asp:Literal ID="LitContent" runat="server" /></p>
LitContent.Text = textService.GetText("ContactInfo");
LitContent.Text = textService.GetText("ContactInfo").Replace("<br />", " ");
but you should check how the BR is formatted from the editor. It may be capitalized or without /
It is also possible that the HTML generated by the editor uses paragraphs instead of br. In this case it becomes more complex to remove them. Basically to answer your question correctly we need more information. What is the actual string that GetText returns.
This looks like a formatting Problem.
There's a string and you can replace the Linebreaks out of a string. The code shown below do this by replacing the Linebreak with a blank. Should be the easiest way of doing this
infoText = textServices.GetText("ContactInfo");
infoText = infoText.Replace(Environment.NewLine, " ");
LitContent.Text = infoText;
I am working on an application that involves the user clicking on a hyperlink to popup an outlook email template. I have the SendTo values, and the subject values.
How do I enter text into the body of the email?
In the hyperlink you can add the ?body= variable after the email address. Formatting the body will be a challenge because for symbols like spaces you have to use hex codes (space = %20, newline = %0D). I don't know what your design criteria are, but most of the time I prefer to create a form with the desired input fields and let .NET handle the sending of the e-mail message on the submit.
Are you searching for this?
...