Link to home
Start Free TrialLog in
Avatar of md0333
md0333Flag for United States of America

asked on

Checking if user has Outlook and then...

I have an app that collects email addresses. I want the user to be able to select the email addresses they want and then push them into the Outlook BCC field. I have no idea where to even start with this...

Basically, I just need to know how to check if a user has outlook on their system... and how to put items to the BCC field if they do.

I've already taken care of the string of email addresses...

Thank you
Avatar of Bill Nolan
Bill Nolan
Flag of United States of America image

I haven't checked this out myself but look into MS Outlook command line parameters.
Avatar of the_o
the_o

Hey
Try this

        Try
            Dim TheApp As String = "Outlook.Application"
            '"word.application"
            '"excel.application"
            '"access.application"
            '"SomeProgram.ApplicationType"

            Dim oApp As Object = CreateObject(TheApp)
            bInstalled = True
        Catch
            bInstalled = False
            MessageBox.Show("Office Application not installed!", "Office Installed", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
        End Try

Open in new window

Try
            Dim TheApp As String = "Outlook.Application"
            '"word.application"
            '"excel.application"
            '"access.application"
            '"SomeProgram.ApplicationType"

            Dim oApp As Object = CreateObject(TheApp)
            bInstalled = True
        Catch
            bInstalled = False
            MessageBox.Show("Office Application not installed!", "Office Installed", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
        End Try

Open in new window

Avatar of md0333

ASKER

OK... so that takes care of the "check if user has outlook installed"

I ran that and it passed... I'm guessing it's correct since my computer has outlook. So now to the second part... how do I build an outlook object and put my string of email addresses in the BCC field? The user will add there own subject and body content to the message. Please include any "imports" or references I need to make or put on my page.

Thank you
ASKER CERTIFIED SOLUTION
Avatar of the_o
the_o

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of md0333

ASKER


the_o:
Looks good... tested and worked well on my machine. My concern is that my reference version is 12.0. (I didn't see 11.0) What if a user has an older version of Outlook? Some of our clients may have versions of Outlook that are 7-8 years old. Is this backwards compatible? Or, do I need to add references to older versions? And if so, do I need to change the code at all?
Avatar of md0333

ASKER

... I'm being told that this code does not use the Users outlook but the servers...

I'm trying to check for the user of the web app. Is that what this code is doing? Or, is it looking at the server since this is being done in code behinde?
Avatar of md0333

ASKER

I realized the answer I got was correct for what I asked for (I never mentioned it was a web app) so I will award points.

What I ended up doing is below and seems to be working perfect so far.

            function InsertMailToTag() {

                var emailstring = getEmails();
                
                emailWindow = window.open("about:blank", "a", "width=400,height=200,menubar=no,toolbar=no, status=no, location=no");
                with (emailWindow.document) {
  
                    writeln('<html><head><title>FI-Traxx</title><scr' + 'ipt>self.focus();self.moveTo(200,200);</scr' + 'ipt></head>');
                    writeln('<body bgcolor=#202020 link=#74ac42 vlink=#df7e2a alink=#df7e2a>');
                    writeln('<font face=Arial size=2 color=#ffffff>');
                    writeln('<IMG SRC="Images/fitraxxsplashdkBGMedium.png" WIDTH="170" BORDER="0" HEIGHT="47" HSPACE="10" VSPACE="5" ALIGN=left></IMG>');
                    writeln('<br><br><br><br>Click on the link below to add the selected Email addresses.<br><br>');
                    writeln("<a href='mailto:?bcc=" + emailstring + "'>FI-Traxx: Create Email Campaign</A>");
                    writeln('</font>');
                    writeln('</body></html>');
                }

            }

            function getEmails() {

                var grid = $find("<%=RadGrid1.ClientID %>");
                var MasterTable = grid.get_masterTableView();
                var email;

                var selectedRows = MasterTable.get_selectedItems();
                for (var i = 0; i < selectedRows.length; i++) {
                    var row = selectedRows[i];
                    var cell = MasterTable.getCellByColumnUniqueName(row, "Email")
                    if (i == 0)
                        email = cell.innerHTML
                    else
                        email += ";" + cell.innerHTML
                }

                return email;

            }

Open in new window