I have searched and think I have found what I need to create Outlook tasks from my Excel spreadsheet. I'm hoping that someone here can help me pull it together into something that will be usable in my project tracking spreadhsheet...
I try to keep track of milestones... these milestones are listed in column B of my spreadsheet and are in rows 10 through about 105
For each of my customers I then keep 4 columns D, E, F, G - H, I, J, K - L,M,N,O - etc. Each group of 4 is a different customer....
The customer's first column (D, H, L, etc.) is a Due date of the Milestone that is found in column B. The second column is a check box that I use to indicate when the milestone is complete The 3rd column is the completion date The last colum is just a filler space that helps to separate each customer.
What I would like to do is insert a button at the bottom of EACH grouping of 4 that when pressed would look at the first column for the customer group and for ANY Milestone that has a DUE date process the stuff in the VB below to create an OUTLOOK task for each item that has a DUE date. (It would be conceivable that as it stepped through each row for a customer group of columns that I could have it create 90+ Tasks in Outlook.
A couple of additional things... in row 110 for the first column of the customer I have a DATE or a blank. So for example in D110 it might be blank or a date like 10/29/2007. If it is blank then when I press the button it would loop through ADD the tasks for each row with a due date. If row 110 has a DATE I would get a popup indicating that the tasks are already in OUTLOOK and that they were added on whatever the date is in row 110... This is kind of the safeguard that I don't get the same group of tasks multiple times by pressing the button by mistake.
In Excel, I want VBA to refer to the SENT ITEMS folder in Outlook. I want to loop over all sent items, and if the email address satisfies a condition, then record that fact in Excel. I am good at VBA in Excel, and I have a passing knowledge of VBA in Outlook, but I don't know how to refer to Outlook within my Excel VBA.
Below I have my code that works great. What I would like to do is make it pull the .HTMLBody from a cell value instead of inbeded in the code so users can change, just like to I have it below for who I am sending it to. The issue is if I do it the same way I loose my signature and the font, size and color I have below. How can I do this.
range("P16") would be the 1st line of the mesage range("P17") would be the 2nd line of the mesage range("P18") would be the 3rd line of the mesage
All the sendkeys below copy a range and paste it below my message as a picture currently. That is fine.
I'm in search of a VBA macro which will send a mail through outlook automatically with the count of files(.pdf + .msg files) in any given folder.
I work for an organization, where we use Outlook for mailing purpose.
Everyday Inventory(.pdf files and .msg files) will be saved in a folder that is to be processed.
I want a macro which should automatically send the total inventory (.pdf files + .msg files) through my outlook mailbox(say: me@outlook.com) to a my superiors outlook mailbox(say: superior@outlook.com).
If the macro sends that email to my superior before me and my superior logon to computers at perticular time (say: 7:00AM daily), need to plan our day at work.
I am having trouble figuring out how to paste an Excel Worksheet into Outlook. I am using '07 versions for both. I currently have code that when a button is selected, Outlook opens and has form text that I have entered. I just cant figure out how to get the worksheet pasted into the body of the email after this text. Here is what I have:
i am using the attached sheet to export data from excel to outlook calendar from last 2-3 months. Now suddenly it stopped working for me (I didn't amend the code)
All the data i have filled in is in the correct format but the code doesn't export the data after ROW 72.
Im searching for a way to send a .PDF of 1 worksheet via outlook. I have seached the forum, and have tried to follow Ron De Bruin's web page on how to do this but fall short. Im currently using his code to send the excel sheet.
I am probably overengineering my macro, but I would like to setup an outlook appointment in two peoples calendars from my userform. The macro has access to the email addresses of the selected persons, I just want to send date/time and subject.
I have some code to literally email a workbook to a specific user. But when the email is sending...i am getting the warning form Outlook whethere to send or not. If the user clicks No...then this opens up a can of worms when asking to debug. Is there a way i which i can amend the code to disable this warning and send regardless...without changing security settings in outlook???
I have to send out emails to all of my staff with their new login ID's and PW's and other misc information one by one to each user. Reason being is that all ID's, PW's and other information pertains to that specific user and includes sensitive information.
I know there's a VBA script I can use to send out the emails, but the script I found online keeps crashing my Outlook and requires it to go through my personal inbox which takes 15 minutes every time.
I have the pertinent information split up into different columns/cells.
A1: email A2: subject A3: body (ID, PW, verbage) A4: attachment link (if required) A5: if I could have Outlook automatically stamp each email with my signature that'd be awesome as well.
I would like to send an image that has a hyperlink in an email, so when the user receives the email they can click the image and it will take them to a webpage.
I have a sheet with an invoice on and wish the Macros to make it easy for users.
I have this code which saves as PDF, Prints and saves my worksheet. However I want to send the PDF to Outlook with To: and cc: completed using the Macro.
Sub PlasticParts() 'Saves active worksheet as pdf using concatenation 'of A1,A2,A3 Dim fName As String With ActiveSheet fName = .Range("A1").Value & .Range("F2").Value & .Range("A3").Value .ExportAsFixedFormat Type:=xlTypePDF, Filename:= _ " [Code] ..........
I have successfully adapted some code to create e-mails in outlook, insert text, add an attachment and specific who to send - all from within excel.
However, all of the recipients are contacts in our internal address book and what I would like to do is use the "shortened" version of their contact to send the e-mail.
e.g. Simon Jones e-mail address might be simon.jones@mycompany.co.uk - but if I simply type in Simon Jones; and then tab to the next line, outlook works out who this is all on it's own.
The problem is, if I specify in my code to send to Simon Jones; it does not convert it / work out who it is.
All my emails have a specific Subject line pattern. e.g. if the request is for Jason.. The subject line is "Issue with Desktop [JAS].. There are 10-15 such names and each one of them has a short name in the subject line of the email.. For each of those names there is a folder. I would want subject lines with [JAS] to move to JAS folder and so on..
I have an Excel form that requires the user to enter the name of their manager. Rather than entering the names manually I would like to use the Outlook address book but I've run into a dead end due to my limited knowledge.
Sub GetOutlookAddressBook()
Set appOutlook = CreateObject("Outlook.Application") Set CDOSession = appOutlook.CreateObject("MAPI.Session")
CDOSession.logon "", "", False, False, 0
Set Recipients = CDOSession.addressbook(Nothing, "Select Distribution List Members", False, True, 1, "To:", "", "", 0)
I am trying to establish if Outlook 2000 is currently running in VBA , I have tried the following code but this only works when the user is actually positioned in "Inbox - Microsoft Outlook" etc. At this point I don't really care where/what the user has open in Outlook but merely to check if outlook is running.
I have tried below but does not work robustly enough. I have also tried AppActivate("Microsoft Outlook") I have also tried IsRunning("Outlook.Application") which does not even compile.
Dim OutlookErr, OutlookBox On Error GoTo OutlookIsNotRunning AppActivate ("outlook") GoTo now_send_email
OutlookIsNotRunning:
OutlookErr = "Outlook is either not open or busy with another task." & vbCrLf & vbCrLf OutlookErr = OutlookErr & "Please Open Outlook, Close any draft emails," & vbCrLf & vbCrLf OutlookErr = OutlookErr & "the Global Address List or other activities and try again." OutlookBox = MsgBox(OutlookErr, vbCritical, "Unable to access Outlook to send email") Exit Sub
I am using this peice of code from another post in order to fill a ListBox with Outlook addresses. It works fine, but the the list has thousands upon thousands of names and it takes forever to run. I thought I'd add code to only add specific entries based on what a user inputs to a TextBox, but it doesn't seem to speed-up the process. how I can get to the user-defined data more quickly?
Private Sub CommandButton2_Click() Dim olApp As Outlook.Application Dim olNamespace As Outlook.NameSpace Dim olItem As Outlook.AddressEntry Dim olAddressList As Outlook.AddressList Dim olAddressEntry As Outlook.AddressEntry
I am using a code copied from Ozgrid to email a worksheet but the code doesn't seem to work?
Sub Mail_Sheet_Outlook_Body() Dim rng As Range Dim OutApp As Object Dim OutMail As Object With Application .EnableEvents = False . ScreenUpdating = False End With
Set rng = Nothing Set rng = ActiveWorkbook.ActiveSheet.PrintRange 'UsedRange Set OutApp = CreateObject("Outlook.Application") OutApp.Session.Logon .......................
I have been trying to use VB to send contacts from contacts.xls to outlook. I have some code from MSDN that shows me how to put in ONE contact (which is already declared in the code). Well I was thinking of writing something to take a worksheet that has x number of contacts and automating x number of contacts. The problem is, I am familiar with using SQL to pull records, but I was thinking there was something easier like importing the excel namespace. So I decided to try it out this way and found this little tidbit of code which is:
Dim xlApp As New Excel.Application Dim xlBook As Excel.Workbook Dim xlSheet As Excel.Worksheet xlApp = New Excel.Application xlApp.Visible = False xlBook = xlApp.Workbooks.Open("contacts.xls") xlSheet = xlBook.Worksheets(1)
'READ FILE HERE Dim pXLRange As Object
pXLRange = xlSheet.UsedRange
Dim i = 0 Dim j = 0 For i = 1 To UBound(pXLRange, 1) For j = 1 To UBound(pXLRange, 2) Debug.Print(pXLRange(i, j)) Next Next
It gives me this error for the FOR i=1 to UBound line:
Unable to cast COM object of type 'System.__ComObject' to class type 'System. Array'. Instances of types that represent COM components cannot be cast to types that do not represent COM components; however they can be cast to interfaces as long as the underlying COM component supports QueryInterface calls for the IID of the interface.
I have a range in an Excel worksheet named 'Request'. I want to paste this range into the body of an email and send to sepcified recipient via outlook. I tried the following code, but this does not seem to work. Am I not referencing to Outlook correctly?
Private Sub cmd_Send_Request_Click() Dim objol As New Outlook.Application Dim objmail As MailItem Dim varBody As String Dim objdata As DataObject Set objol = New Outlook.Application Set objmail = objol.CreateItem(olMailItem) Set objdata = New DataObject Application.Goto Reference:="Request" Selection.Copy objdata.GetFromClipboard varBody = objdata.GetText With objmail .To = "kully.rai@ca.com" .Subject = "Benchmarking Request" .body = varBody & vbCrLf & vbCrLf .NoAging = True .Display End With Set objmail = Nothing Set objol = Nothing End Sub
I have attached a version of my file with code that I have adjusted. Everything is working except for the save as portion of it. I keep getting a run time error 1004. The save as of the workbook failed. Also, when I run the macro in the template that I have uploaded it opens up the original file that I had the code in.