Modules & VBA :: MS Access To Open Outlook (MSG) File
Oct 20, 2014
when I open a .msg file using
dim x as long
x = Shell("""C:Program Files (x86)Microsoft OfficeOffice15Outlook.exe"" /f ""D:mymessage.msg""")
how to access the fields "To", "CC", "Subject", "Date", "Body text", etc ?
My problem: I have a lot of files .msg (about 1000) and I want to put them in a single file (preferably in txt).
View Replies
ADVERTISEMENT
Mar 15, 2012
In an ACCESS DATABASE I have 2 fields
-email_address
-language
I want make double click on email_address field and open a specific files msg
example :
double click on gimec.roberto@gmail.com
if the language is ITALIAN open in OUTLOOK file ITALIAN.msg
if the language is RUSSIAN open in OUTLOOK file RUSSIAN.msg
View 1 Replies
View Related
Jan 18, 2015
I use the below code to open an access database, but it opens for a second and then closes. When I run the same code from excel, it works OK.
Code:
Sub OpenDatabase1()
Dim LPath As String
Dim LCategoryID As Long
[code]....
View 6 Replies
View Related
Jul 8, 2013
I like to do following task using access VBA:
1. Open outlook.
2. Select word file(with tables and graphics) and insert into new outlook email.
View 1 Replies
View Related
Nov 18, 2014
I want to open different .doc files by a button from access.
I want that the vba code checks where the current access database is located. In which folder the the current access database is.
In this file folder i have a folder called documents.
In this folder i have the .doc files.
Right now i have the following code.
Public Function getPath(ByVal iPath As String)
Dim fso As Object
Dim drive As String
Set fso = CreateObject("Scripting.FileSystemObject")
drive = fso.GetDriveName(CurrentDb.Name)
[Code] .....
The access database is in the folder Z:BUS MMM CGrimmMasterarbeitDatenbank
I would like to have something like
spath = getpath("documentswissen.doc")
How can i do that?
View 2 Replies
View Related
Oct 8, 2013
From access I'm calling a code in excel. My code in excel pops up a browser that allows the user to select what files they'd like to import. For various reasons I have to import data through excel, not directly to Access which is why the browser appears in excel instead of access. Essentially the user will select a word file which is imported into access through excel.
I'd like this browser to appear in access instead of excel though. If I move my browser from excel to access is there any way to have my code in excel reference the file selected in access? Or is there some way for this browser to appear without the user having to select the excel icon in the task bar? I essentially want the user to only see and interact with access, but because my browser is in excel this isn't possible right now.
View 2 Replies
View Related
May 25, 2015
I want to delete an excel file from within access vba. Problem is that if the file is open, it obviously cannot be deleted. so I need to check to see if that specific excel workbook is open and if it is, I want to close it before I can delete it.
All of the answers here involve creating an excel object and opening it before closing it. If I do that all that happens is a second instance of the workbook opens then closes leaving the originally open workbook still open.
Sub xx()
Dim XLapp As New Excel.Application
Dim ObjXL As Excel.Workbook
Set ObjXL = XLapp.Workbooks.Open("C:dropboxexcelimport.xlsx ")
ObjXL.Application.Visible = True
[Code] .....
The above code demonstrates my problem, if the import.xlsx file is already open then the code just opens another instance of this workbook and then closes it again leaving the original workbook open and as such cannot be deleted.
View 3 Replies
View Related
May 15, 2015
I have created an action log database that sends an email when a new action is entered. I would like to launch the database using a hyperlink in the email, but can't seem to get it to work. All users have a copy of the front end on their desktop, so whatever I add to the email needs to launch the front end for any user signed on to their own desktop.
This is what I have and it sends a hyperlink but I click it, I get an error saying it can't find the file. I don't know how to word the path name for any user?
With obMsg
.subject = "New action request for " & team
.To = people
[Code].....
View 14 Replies
View Related
May 27, 2015
We have an access database which has a form that has a list box that details particular records. See attach "list box".
What I would like to do is double click on the record and this would look in a powerpoint folder (see attach "path") and open the presentation if there is a match to the value in Listbox Column 5 i.e. Tool Number.
I can get it to open the presentation if I include the tool number in the path but I cannot seem to be able to get it to compare the values and only open if there is a match.
View 4 Replies
View Related
May 21, 2014
My application relies on whether Outlook is open and more importantly, with the correct Exchange profile selected. To ensure this I have the following code which, on the work PCs (Windows XP and Office 2003) works correctly.
Code:
If Outlook_is_Running = True Then
Set myOlApp = CreateObject("Outlook.Application", "localhost")
Set myNameSpace = myOlApp.GetNamespace("MAPI")
Set colFolders = myNameSpace.Folders
On Error Resume Next
[code]....
The work PCs are being upgraded soon to Windows 7 and Office 2007 so I have taken the application home and started to develop it on my home PC (Windows 8.1 64 and Office 2013 64). I have used PtrSafe where necessary and have compiled with no errors, but this code always returns false even though Outlook 2013 is open.
On further investigation, if I comment out the 'On Error Resume Next line I get the error Active X component cannot create the object (or similar) Error 429. This is the same regardless of whether Outlook is open or not
View 4 Replies
View Related
Feb 3, 2014
I'd like a command button to open Outlook and create a new email message with the To and Subject fields already populated with what I want, is there anyway to do this?
View 1 Replies
View Related
Jun 26, 2014
I would like to create a button that when pressed opens up an outlook email. The email address will be populated by one email address every time. I don't want it to automatically send as the body will need to be filled out by the user. It would be useful if the date and time it was sent could be recorded in the form somewhere too (would this be in a text box?).
View 3 Replies
View Related
Oct 13, 2014
I want to send an e-mail with a report as attachment.On the internet i have found two options, and both are not the best solutions.
1. option
Code:
DoCmd.SendObject acSendReport, sReport, acFormatPDF, sMailAdres
With this construction I don't have enough control over the mail, and worse, I get an Outlook message when the mail is sending which I have to answer.
2. option
Code:
Dim oMail As MailItem
Dim oAtt As Attachment
Set oApp = CreateObject("Outlook.application")
Set oMail = oApp.CreateItem(olMailItem)
DoCmd.OpenReport ReportName:=sReport, View:=acViewPreview, WindowMode:=acHidden
Set rpt = Reports(sReport)
[code]...
with this construction I have to enter an existing report.pdf on my filesystem (bold line), but I want to pass the rpt object straight to the mail as an attachment.
View 2 Replies
View Related
Oct 4, 2013
I recently upgraded a DB from 2003 to 2013 and ran into the following problem.
I have a button that opens a file dialog box and allows the user to upload a file to a predetermined location (and store the address as a hyperlink). I borrowed this code from someone else on here and modified it slightly.
In any case, the button still works, but now when it opens it doesn't have an option for "All files" under file types. So I can upload MS Office files, text files, etc., but not PDF files which are by far the most common types my users upload.
Here's my code and a screenshot is attached.
Private Sub Command35_Click()
Dim dd As Integer
Dim fileDump As FileDialog
Set fileDump = Application.FileDialog(msoFileDialogOpen)
dd = fileDump.Show
[Code] ....
View 3 Replies
View Related
Dec 16, 2012
Occurs when I try using the Create Email button. I've enabled the access add in in Outlook. Same message comes up when Outlook is closed or open.
View 4 Replies
View Related
Apr 10, 2013
I have a macro set to email a form to a person once a condition is met. This works fine but I've discovered that Outlook (2010) has to be open BEFORE this macro is invoked.
I wanted to add a step to the macro before the one that makes it email that basically says to open Outlook.
I have tried the RunApplication macro, but I apparently am not getting the path right. I don't understand what the problem is.
I accidentally dragged Outlook to my desktop and therefore created a shortcut from my Start Menu, but now when I go to Microsoft Office in my Start Menu, Microsoft Outlook isn't one of the options. I can't find the path to where it may reside now.
I am using the path to the shortcut on my desktop.
C:UsersJust MeDesktopMicrosoft Outlook 2010
What else am I supposed to do?
View 8 Replies
View Related
Nov 21, 2013
I have limited programming skills but a basic understanding of databases.I want to create a database in Access that links to contacts in an Outlook pst file, and in the Access database I want to create a series of date dependant tasks or processes that I can apply to the relevant contact.The object being to to save that collection of tasks to apply to different contacts within Access.
View 2 Replies
View Related
Jul 11, 2007
I have a button in the form of the current access file. What I want to do is when the user click on the button,
triggered the vba to backup current access file. But since the file is currently open, is this possible? If yes, may I know how to do it with vba?
I have tried two methods but failed:
1) Use copytofile method, but I get permission denied due to file open;
2) Use dbengine.compactdatabase method, but it also has problem if the file is open.
View 3 Replies
View Related
Mar 6, 2015
I have an Outlook Function that i am trying to run from Access.What i am looking for is to Open Outlook through Access and run the Outlook function from Access.
View 7 Replies
View Related
Aug 1, 2013
I have a query that opens a listbox in a form. In the listbox I want to add a doubleclick event that opens a pdf document with the selected record in it. The record is in column 1 of the listbox.
I can't use the FollowHyperlink method of the colecction application due the record in the column is a Key. I am not sure if FollowHyperlink method can be used in a listbox
I have been checking codes in the web and I found this:
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
ShellExecute Me.hwnd, "open", "D:SebDesktopGA-BDpdf est.pdf, "", "", 4"
However, I don't know how to organize the code in a logic way in Sub End Sub. Neither I don't know if the code is for the doubleclic event in the list box or a Module. If is for a module I don't know how to write the code in it.
View 7 Replies
View Related
Sep 11, 2014
I am programmatically importing Outlook into Access and I want to restrict it to only those contacts that have been updated since the last import. My program has some date conversion or syntax flaw that I can't figure out. The important parts below...
DateStart = #1/1/1900#
DateStart = Nz(DMax("CMDBCreatedDateTime", "Outlook_Control"), #1/1/1900#)
MsgBox Format$(DateStart, "General Date")
[Code].....
View 3 Replies
View Related
Mar 13, 2015
I have the below script:
For Each Item In offexchfldr.Items.Restrict("[SenderName] = '" & frmfm & "'") ' Select Items that match Sender Name on form
If Item.TaskSubject = subid Then
Item.Categories = frmcat ' Update category from form to outlook
Item.Save
End If
Next
This script checks every item in the outlook inbox where the item.SenderName = my database sendername
This works every time except for when the sendername has quotes or single quotes in their name. So i am trying to utlize the replace method on the item sendername before trying to find the items in the inbox but its not working.
Below is my attempt that does not work.
For Each Item In offexchfldr.Items.Restrict("Replace([SenderName],',"") = '" & frmfm & "'") ' Select Items that match Sender Name on form
View 2 Replies
View Related
Feb 3, 2014
I build MS Access databases for small businesses. Generating emails from within Access is no problem - I can even use Access VBA to select specific email accounts and email signatures. However, I have not been able to find a way to use Access VBA to select a Theme that was set up in Outlook. If I create a Theme using the Outlook 2010 menu selections: Options / Mail / Stationery and Fonts / Theme, that theme is present every time I generate a new email from within Outlook. But if I generate a new email via Access VBA, that theme is no longer present - the email that VBA generates has no Theme. What Access VBA code do I need to use to select an Outlook Theme - even just the default Outlook Theme?
One thought is that if someone knows the keyboard shortcuts to select an Outlook Theme, I can do the rest. I can use SendKeys. But if there is a more sophisticated way of making the Theme appear on emails generated by Access VBA, I am eager to learn.
I am using Access 2010, by the way.
View 2 Replies
View Related
Feb 6, 2015
It's been some time since I wrote the following, which takes a string made up of "Lastname Firstname Telephone" and writes it at a specific time in Outlook. It uses Late binding so it works across all Oulook versions.
Code:
Public Function funOutputAppointmentToOutlook(dtmDate As Date, strSubject As String)
Dim olApp As Object
Dim mNameSpace As Object
Const olFolderCalendar = 9
Const olAppointmentItem = 1
[Code] ....
I would like to first check the specific Outlook time slot whether the string exists already and only if it does not exist to write it.
View 1 Replies
View Related
Aug 15, 2013
How to write some code that will search a known drive and folder structure for a tif file and on finding it, open that tif file.
The known drive/folder structure is as follows:
M:CustomerSatisfactionStdDGImages
or it could have the full path as follows:
prdfs01QUESTIONSCustomerSatisfactionStdDGImag es
and then there are the following folders which contain any number of tif images:
01_Q
02_Q
03_Q
04_Q
05_Q
06_Q
07_Q
10_Q
11_Q
12_Q
13_Q
14_Q
17_Q
18_Q
19_Q
20_Q
21_Q
23_Q
24_Q
28_Q
29_Q
30_Q
31_Q
32_Q
33_Q
34_Q
35_Q
36_Q
37_Q
38_Q
39_Q
AR_Q
HE_Q
SKY_SKY3B
I would like to have a button in a form that the end user clicks and they then enter the name of the tif file they are looking for and on pressing enter the file is searched for and if found it is automatically opened up for them to see, if it is not found then a message "File Not Found" is displayed.
I Believe that I will need something like this:
Code:
Dim FS As FileSystemObject
Dim filenum As Integer
Dim tmp As String
Dim Folder As Folder
Dim subFolder As Folder
Dim File As File
[Code] .....
It's when I get to this point that I've got stuck, I don't know how to structure the code required to do the search and on finding the tif file open it.
An example tif file I might search for is: 0H214_2CJ0001905.tif.
View 11 Replies
View Related
Aug 19, 2014
I am very new to VBA. I found some code that will allow me to add an appointment to my personal calendar with using access VBA and it works great. It also allows me to add an appointment to another calendar created under "My Calendars" folder.
I wanted to know how to change the code in order to add the appointment to the SHARED calendar instead.
The main folder is called "Shared Calendars" which is at the same level as the default "My Calendars" folder. Under the "Shared Calendars" folder the calendar is called "Tester".
Here is the code im using at the moment: I believe I have have to change the line of code that is in red but I don't know how.
Private Sub cmdAddAppt_Click()
On Error GoTo cmdAddAppt_Err
Dim outobj As Outlook.Application
Dim outappt As Outlook.AppointmentItem
Dim olNS As Outlook.NameSpace
[Code] ....
View 1 Replies
View Related