Ribbon handling in c# for outlook 2010 - ribbon-control

I have placed my own ribbon in Outlook 2007 at a certain location. But when I run the code for outlook 2010 ribbon is not there where I want it like 2007. It has been placed at last position. Is there any solution for this?

The Group ID's are different in Outlook 2007 and Outlook 2010. First, figure out if it's Outlook 2007 or 2010:
using Outlook = Microsoft.Office.Interop.Outlook;
Outlook.Application thisApp = new
Outlook.Application();
string outlookVersion = thisApp.Version;
if (outlookVersion.StartsWith("12."))
// it's probably Outlook 2007
// Outlook 2010 should start with "14."
Next, use the right ID for the version of Outlook. You can download spreadsheet with all the ID's from Microsoft at http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=3582

Related

Emulator to inspect an element on the outlook

I am working with e-mail templates, and the client tests on outlook 2019, gmail and yahoo.
Is there any way to inspect the element in outlook-2019 ? I know this can't be done on the actual app, but maybe some kind of emulator or something similar ?
Yes, you can use any of these popular tools:
1 - Litmus https://litmusapp.com/
2 - MailChimp https://www.mailchimp.com/
3 - CampaignMonitor https://www.campaignmonitor.com/
4 - testi https://testi.at/
5 - Email on Acid # https://www.emailonacid.com/

Mail Merge Feature for a CRM web-app made in asp.NET

We're working on a web based CRM for my company in ASP.net. I frequently have to send newsletters to all of my customers, and it becomes tedious to manually copy all of their addresses. What I would like is a feature to send one mail to all of my customers, taking their addresses from our contacts database, similar to a mail merge.
My developer said that he can do this for Emails, but not for physical mail. His reasoning behind this is that he can write a script that sends the mails to all customers one by one, but he can only give one single print command, which would only be able to print the current contents of the page. Therefore, he would not be able to print the individual letters for all of the customers.
Does anyone have ideas on how this would be possible? E.g. printing the page in such a way that each letter would be printed on a seperate page, or another way to automatically print all of the letters (with the mailmerged fields)?
Any help will be appreciated. If you require more details, please tell me.
A webpage is not the right solution to physically print letters. What you need to produce is a report that would generate a PDF file. This report will generate a PDF document with a different customer address on each page. Try using Microsoft Reporting Services, it is included in SQL Server. Crystal Reports is also a popular reporting solution too.
Also, you will have a hard time printing the stylized contents of your nice looking e-mail in the reporting solutions mentioned above. Consider using the report only as the cover letter of your mail piece.
One possible solution is to use 3rd party library for creation of individual letters for your customers. Docentric Toolkit is .NET tool that solves exactly your problem. We are using it for creating individual letters for customers and they all are merged in one file so that printing is done only once. Users can even create or change template documents.
Next you would have to create a template document in MS Word where you would include fixed content and placeholders for variable content which would be filled in at runtime with customer information.
After processing the data in .NET application you merge the data with the template document (see code snippet below). Your final document will be one file with letters for your customers, each on its own page. This file can then be sent to the printer with one print command.
I am attaching a code snippet of a Main method of the sample console application. The project has references to Entity Framework and Docentric’s dlls and uses entity model of Northwind database.
As you can see, it is really easy to prepare the data and merge it with template document. Solution is suitable for ASP.NET and MVC applications because you don’t need Microsoft Office installed on the server.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
using Docentric.Word;
namespace DisplayCustomers
{
class Program
{
static void Main(string[] args)
{
// first we read customers - in the example we select only customers
// from USA and Canada and order them by country and customer name
List<Customers> customerList = new List<Customers>();
using (var db = new NORTHWNDEntities())
{
customerList = db.Customers
.OrderBy(o => o.Country)
.ThenBy(o => o.CompanyName)
.Where(w => w.Country == "USA" || w.Country == "Canada")
.ToList();
}
// next we merge customers data with the template and generate final document;
string templateDoc = #"C:\Test\Templates\CustomerLetter1_templ.docx";
string outputDoc = #"C:\Test\FinishedLetters\CustomerLetters1.docx";
DocumentGenerator dg = new DocumentGenerator(customerList);
DocumentGenerationResult result = dg.GenerateDocument(templateDoc, outputDoc);
}
}
}

Outlook deletes my programmatically-created meeting

I'm sending some programmatically-created meetings to Exchange 2010 accounts through an ASP.NET application. Everyone receives without any problem the invitation email except the organizer, whose Outlook 2013 sends it to the Deleted Items folder directly. "Meeting cannot be found in the Calendar", it says.
I imagine it's happening because indeed the organizer does not have that meeting in his calendar and Outlook fails trying to set everything for him.
Here's the body:
string strBodyCalendar = "BEGIN:VCALENDAR\r\nMETHOD:REQUEST\r\nPRODID:Microsoft CDO for Microsoft Exchange\r\nVERSION:2.0\r\nBEGIN:VTIMEZONE\r\nTZID:(GMT-06.00) Central Time (US & Canada)\r\nX-MICROSOFT-CDO-TZID:11\r\nBEGIN:STANDARD\r\nDTSTART:16010101T020000\r\nTZOFFSETFROM:-0500\r\nTZOFFSETTO:-0600\r\nRRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=11;BYDAY=1SU\r\nEND:STANDARD\r\nBEGIN:DAYLIGHT\r\nDTSTART:16010101T020000\r\nTZOFFSETFROM:-0600\r\nTZOFFSETTO:-0500\r\nRRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=3;BYDAY=2SU\r\nEND:DAYLIGHT\r\nEND:VTIMEZONE\r\nBEGIN:VEVENT\r\nDTSTAMP:{8}\r\nDTSTART:{0}\r\nSUMMARY:{7}\r\nUID:{5}\r\nATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"{9}\":MAILTO:{9}\r\nACTION;RSVP=TRUE;CN=\"{4}\":MAILTO:{4}\r\nORGANIZER;CN=\"{3}\":mailto:{4}\r\nLOCATION:{2}\r\nDTEND:{1}\r\nDESCRIPTION:{7}\\N\r\nSEQUENCE:1\r\nPRIORITY:5\r\nCLASS:\r\nCREATED:{8}\r\nLAST-MODIFIED:{8}\r\nSTATUS:CONFIRMED\r\nTRANSP:OPAQUE\r\nX-MICROSOFT-CDO-BUSYSTATUS:BUSY\r\nX-MICROSOFT-CDO-INSTTYPE:0\r\nX-MICROSOFT-CDO-INTENDEDSTATUS:BUSY\r\nX-MICROSOFT-CDO-ALLDAYEVENT:FALSE\r\nX-MICROSOFT-CDO-IMPORTANCE:1\r\nX-MICROSOFT-CDO-OWNERAPPTID:-1\r\nX-MICROSOFT-CDO-ATTENDEE-CRITICAL-CHANGE:{8}\r\nX-MICROSOFT-CDO-OWNER-CRITICAL-CHANGE:{8}\r\nBEGIN:VALARM\r\nACTION:DISPLAY\r\nDESCRIPTION:REMINDER\r\nTRIGGER;RELATED=START:-PT00H15M00S\r\nEND:VALARM\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n";
strBodyCalendar = string.Format(strBodyCalendar, dtStart.ToUniversalTime().ToString(strCalDateFormat), dtEnd.ToUniversalTime().ToString(strCalDateFormat),
strLocation, strOrganizerName, strOrganizerEmail, Guid.NewGuid().ToString("B"), strSummary, strSubject,
DateTime.Now.ToUniversalTime().ToString(strCalDateFormat), macAttendeeList.ToString());
I'm not sure how to format the body to show that user as the sender (and organizer?) without making Outlook going crazy trying to find something that does not exist.
Through the website I don't have permissions to access the organizer's calendar and create the meeting before sending anything.
Any hints?
I found the answer also in Stack Overflow. Silly me.
iCalendar does not create an event for organizer
Anyway, it cannot be done by sending an email as the organizer, what I want and need; but you can use EWS for sending appointments as a specific account to which you have access. Bummer.

Currency symbol mismatch for Turkey in ASP.NET

I have got a website that shows the money field in local currency for each different region the website is used in. I use the following code to set the right format for a locale (VB.NET):
Case 6 ' Turkey
_amount = Amount.ToString("c0", CultureInfo.CreateSpecificCulture("tr-TR"))
Now the problem is, on my localhost it correctly shows "TL" for Turkish Lira but on my staging deployment server it displays "YTL" which is New Turkish Lira which infact is the old currency symbol and the letter "Y" has been dropped since January 2009 [Source:Wikipedia]. So it should just display "TL". My server's regional settings seem to be fine i.e. they display "TL" for Turkish currency symbol, but I can't figure out where else currency settings can be obtained from. The same code is working in 2 different ways, I will appreciate any insight into this problem.

ASP , extract data from bbs

HI all.
im new to asp programming.
i want to extract data from bbs,http://sports.williamhill.com/bet/en-gb/betting/y/5/tm/Football.html
my plan is first, if i click some button, i go above page and extract 'Daily Match List'.
and with extracted data, i want to remove some unneed part of html source.
so what i want to extract data will be such like following
19:45 UK swidon VS Bristol Rovers 21/20 23/10 13/5
19:45 UK Brazil VS Ukraine 4/9 16/5 6/1
.
.
.
then i want insert this extracted data to excel file .
sorry my english
thanks in advance
I would look at using httpwebrequest - you can then make a web request to that page and access the html from the response. You then need to look for something that will identify the block of information your after and strip this out of the response.
However, there are some downsides to taking a screen scrap approach, if William Hill decide to change the format of the web page then it may break your code.
http://www.netomatix.com/HttpPostData.aspx
http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.aspx
Cheers Tigger

Resources