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[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.
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[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.