View Full Version : Outlook Shortcut
Hi Guys
Im Just wondering if this is possible in email system like outlook which I normally use in my day to day job. We in the office are currently using NT as an OS and aside from that we are also having Citrix. My Idea is I wanted to send email to one person with attachment file (exel), but when this person received the sail email. and review the attachment. Is it possible for him to forward or send the message with the same attachment, to more than one person automatically with one clik. But Im the one who's going to assigned the address for him..(group address) I wanted that to be just like a hyperlink. so that he will not need to type or put any address. Just simple clik the link and he will be on the compose page with everything is ready just to click send.. I hope you guys understand my idea. and if not just let me know. I'll try in another explanation as I can
Ghost_Hacker
05-18-2001, 11:14 AM
Try this VBS code. ( this works only if the end user has Outlook) Cut and paste into a text document, then change the extension to VBS. When you click it an Outlook email from will open.
After looking at the code and the resulting email form it should be clear where to add your information. ( A ' precedding a line is a comment.)Good Luck http://www.PCGuide.com/ubb/smile.gif
dim objOutlk 'Outlook
dim objMail 'Email item
dim strMsg
const olMailItem = 0
'Create a new message
set objOutlk = createobject("Outlook.Application")
set objMail = objOutlk.createitem(olMailItem)
objMail.To = "group name"
objMail.cc = " test carbon" 'Enter an address here to include a carbon copy; bcc is for blind carbon copy's
'Set up Subject Line
objMail.subject = "test subject "
'Add the body
strMsg = "message test" & vbcrlf
strMsg = strMsg & "message test line 2"
objMail.body = strMsg
'To add an attachment,uncomment and use:
'objMail.attachments.add("C:\MyAttachmentFile.txt")
objMail.display 'Use this to display before sending
'Clean up
set objMail = nothing
set objOutlk = nothing
'end sub
------------------
Comment heard from a Klingon programmer.
"Our users will know fear and cower before our software! Ship it! Ship it and let them flee like the dogs they are!"
[This message has been edited by Ghost_Hacker (edited 05-18-2001).]
That's great help Ghost Hacker. But seems that I need some programming background (which I dont' have). Would you mine expleining to me step by step how to follow your procedures.. thanks
Ghost_Hacker
05-18-2001, 12:44 PM
Ok... First in VBS you have Objects and Methods.
The object we want to use is the program "Outlook".
The methods we want to access with Outlook are "create email" ,"Add email recipients ","Add subject line", "add attachment" and "display email".
Now the first few lines contain variables. The "DIM" statement declares them.
dim objOutlk
dim objMail
dim strMsg
The next line declares a constant.
const olMailItem = 0
The "0" stands for "new" and will make more sense later.
Now here's the heart of our code. We first ask that the program "Outlook" be used for creating the items we want.
set objOutlk = createobject("Outlook.Application")
Now we ask that "outlook" creat a email item.
set objMail = objOutlk.createitem(olMailItem)
Notice the variable "olmailitem". This tells Outlook to create a new email.
The next few lines tell Outlook what to place in the "to","carbon copy", and "subject" fields. To use the "group name" the end user would need to have the group already in his contact list. Otherwise you'll need to add the information the old way. (IE: name@server.com;secondname@server.com)
objMail.To = "group name"
objMail.cc = " test carbon"
objMail.subject = "test subject "
The next lines add the actual text to the email.
strMsg = "message test" & vbcrlf
strMsg = strMsg & "message test line 2"
objMail.body = strMsg
Notice that the "& vbcrlf" is a combined carriage return and line feed.
The "&" on the second line adds the statement "message test line 2" to the first. The 3rd line tells Outlook to include "strmsg" in the body of the email.
The next line tells Outlook to insert an attachment. To use this line you would first remove the ' to uncomment it.
'objMail.attachments.add("C:\MyAttachmentFile.txt")
Notice that "("C:\MyAttachmentFile.txt")" tells Outlook where the file to be attached is located.
This next line tells Outlook to display the email.
objMail.display
The last 2 lines simply return the variables values to zero.
set objMail = nothing
set objOutlk = nothing
This I belive is the simpler way to do this. The end user would save the VBS file and the orginal attachment to their "C" drive. Then just clicking the VBS file would do the trick.
In order to have the email open with the attachment already there. You would need to know which number email item this was in the end users inbox. So you could tell Outlook which Email to open.
Someone else may know how to do this in Jscript or even Perl. Don't know if that's easier or not.
Hope this helps http://www.PCGuide.com/ubb/smile.gif
------------------
Comment heard from a Klingon programmer.
"Our users will know fear and cower before our software! Ship it! Ship it and let them flee like the dogs they are!"
[This message has been edited by Ghost_Hacker (edited 05-18-2001).]
Thanks Ghost Hacker. you realy have a briliant mind.. But first I need to find out where I can get the VB. coz Im not having it right now here in my work PC. I'll try to sort it out this problem then I'll let you know.
Ghost_Hacker
05-18-2001, 01:34 PM
Hehehe.... VBS is really easy once you've written a few programs. ( I think I got most of this code from another program I downloaded long ago. I keep all the good Script snippets)
You don't need VB (Visual Basic) just VBS (Visual Basic Script) which comes with Internet Explorer. Or you can download it here:
VBS 5.5 (http://www.microsoft.com/msdownload/vbscript/scripting.asp)
------------------
Comment heard from a Klingon programmer.
"Our users will know fear and cower before our software! Ship it! Ship it and let them flee like the dogs they are!"
[This message has been edited by Ghost_Hacker (edited 05-18-2001).]
Thanks Ghost Hacker... Are yous aying that my existing I.E are having VB script? How to find that?
Ghist Hacker.. After downloading the file you told me.. Im not able to Install it Its asking so many files which is not available in my PC. Im using my work PC now running on Windows NT. under cytrix environment.. Can you advice me whan can be the problem?
[This message has been edited by Roel (edited 05-18-2001).]
Ghost_Hacker
05-18-2001, 04:53 PM
If I remember correctly WSH or Windows Scripting Host comes with IE5 or higher. You need at least IE 4 in order to use WSH .
There could be many reason why the WSH installer won't work in a Citrix enviroment. In a Citrix "world" your really using the server's desktop and apps not the ones on your local computer. ( your interactivly logged onto the server) So without Admin rights to the server you won't be able to troubleshoot it.
------------------
Comment heard from a Klingon programmer.
"Our users will know fear and cower before our software! Ship it! Ship it and let them flee like the dogs they are!"
[This message has been edited by Ghost_Hacker (edited 05-18-2001).]
Thanks again Ghost Hacker, that's what Im thinking when I got that error message. I'll try to find a way how to edit that codes which you gave me. And I'll let you know.
sea69
05-19-2001, 02:03 AM
WoW GH.
http://www.PCGuide.com/ubb/wink.gif
------------------
sea1_69@hotmail.com
homepage (http://www.seanweb1.homestead.com/3.html)
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.