How to automatically pop up new mail message?

E

Eric

I'm running a program in another language which can access all methods of
java, but doesn't have any Outlook integration, so I'm looking for a command
it can execute to create a new Outlook email on a client machine, put in a
To: address for them, attach a document, and leave it open for the user to
edit.

My first choice was a DOS command. I tried this...
"c:\program files\microsoft office\office11\outlook.exe" /c ipm.note /m
"mailto:eek:[email protected]&[email protected]&[email protected]&subject=Yo&body=Hey&attachment=""C:\Folder\File"""

That command for some reason runs beautifully on my machine, but didn't run
on another machine. When it doesn't run, it returns a message about
"command line argument is invalid" but doesn't say what the problem could
be. The command executes without the attachment, and the attachment is a
valid file on both clients.

In my next attempt I tried actually using the MS Office object, but that
gives a security warning. I wrote this in vbscript...
Dim EM
Dim MailItem
' "Creating Outlook object"
On Error Resume Next
Set EM = GetObject(,"Outlook.Application")
If Err.Number <> 0 Then
Set EM = CreateObject("Outlook.Application")
End If
' "Creating e-mail item"
Set MailItem = EM.CreateItem(0)
' "Setting Email Subject"
MailItem.Subject = "A Test"
' "Setting Email Body"
MailItem.Body = "This text is in the body"
' "Setting Email Recipient"
MailItem.Recipients.Add "(e-mail address removed)"
' "Adding Attachments"
MailItem.Attachments.Add "c:\pdf995\output\Q0001447.pdf"
' "Displaying Email Item"
MailItem.Display(True)
Wscript.Quit

When it gets to Recipients.Add, it prompts the user if they want to allow it
to access their address book. I'm not trying to view anything in their
address book. I'm trying to add a recipient using an already known email
address. It's not supposed to be getting any information from their
Outlook, it's not sending any mail, there shouldn't be any warning.
 
E

Eric

I already read that page today. I didn't see anything in there that seems
usable.
Isn't there a way to assign a recipient to an email with the Outlook object
without a security warning? I'm not trying to get any information from
Outlook. I'm not trying to send any email. I just created an email and
attached a file, which it doesn't have a problem with, and I want to fill in
the To address field. I can't seem to get anything in there using the To
property and the Recipients property keeps giving a security warning.
 
K

Ken Slovak - [MVP - Outlook]

That depends on what you consider as usable. I personally use Redemption,
some people like the MAPILabs Outlook Security Manager, others like
ClickYes.

If you read the article there, you know your options to avoid the security.
There are no other options. So use one of the workarounds, or live with the
security.
 
E

Eric

I'm not sure I understand Redemption. Is that a program to install? I'm
hoping to not have to install anything, much less install or update anything
on each client that needs to run this. It's for a local network app, so I
was hoping MS had some security for the Outlook object that could be as
simple as their security for IE (If I create an HTML for the LAN and write
in a "saved by www.mylocaldomain.com" line it doesn't warn when I run
scripts).
 
K

Ken Slovak - [MVP - Outlook]

Redemption is a DLL and must be installed and registered on every machine
where it's used.

Unless you are using Outlook 2007 your only options are what's listed on
that page I showed you. There are no other options. Wishing won't make it
so.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top