![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
Hello,
I have wrote code in Access to create an email message with an attachment ( a .zip file choosen from user through a FileDialogPicker. I would like to save the messa into the Draft folder...now..it seems I'm having trouble with the save method. Debugging says it is all right...but the save method shows in *lowercase* (i.e. mssg.save instead of mssg.Save) ... which sounds like an alert that something is going wrong. If I use the SaveAs method, instead, it shows in the *first letter capitalized* fashion...so what's wrong with the save method? I'm on this thing from this morning and I really canno tfigured out what' wrong. If run the procedure it goes all the way down without any error...but the message is not saved. Here is my code: On Error GoTo email_err Dim objol As Object On Error Resume Next Set objol = GetObject("Outlook.application") Dim msgg As Object Dim vrtSelectedItem As Variant With objol Set msgg = .CreateItem(olMailItem) End With With Application.FileDialog(msoFileDialogFilePicker) .AllowMultiSelect = False ..Title = "Selezionare il file di back up da inviare" ..InitialFileName = CurrentProject.Path & "\ArchivioDati\" ..Filters.Clear ..ButtonName = "Seleziona" ..Filters.ADD "zipped files", "*.zip" If .show=-1 then For Each vrtSelectedItem In .SelectedItems msgg.Attachments.ADD vrtSelectedItem Next vrtSelectedItem msgg.To = InputBox("Indicare l'indirizzo di posta elettronica a cui inviare il messaggio: ", "Indirizzo em@il del destinatario") msgg.Subject = "Invio delle tabelle del database da: " & CurrentUser() & "; il: " & Now() msgg.save Dim myNameSpace As Outlook.NameSpace Dim myDraft As Outlook.MAPIFolder Dim myDestFolder As Outlook.MAPIFolder Set myNameSpace = objol.GetNamespace("MAPI") Set myDestFolder = myNameSpace.Folders(olFolderDrafts) msgg.Move myDestFolder Set myNameSpace = Nothing Set myDestFolder = Nothing Else Set objol = Nothing Set msgg = Nothing Exit Sub End If End With Exit Sub email_err: If Err.Number = 429 Then Set objol = CreateObject("Outlook.application") Resume Next Else MsgBox "La procedura ha riscontrato un errore. Controllare che:" + vbCrLf + _ "a) sia stata fatta l'esportazione delle tabelle" + vbCrLf + _ "b) siano state zippate in un unico file .zip le tabelle esportate" + vbCrLf + _ "c) Microsoft Outlook sia installato e configurato sul proprio sistema.", vbCritical, "Errore nella procedura!" Set objol = Nothing Exit Sub End If Thanks! Rocco |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Send and save a message in folders | anders bitzer | Outlook - General Queries | 9 | April 20th 06 04:22 PM |
After Sending Email: Save Copy of Message to Windows Folder | Ben | Outlook and VBA | 1 | March 25th 06 07:17 AM |
Save Message As | ZR6AJF | Outlook Express | 10 | March 21st 06 10:13 PM |
i get an error message when trying to save a contact | aftershock232 | Outlook - Using Contacts | 3 | February 26th 06 02:14 PM |
Message: Could not save (appointment). Not implemented...Why? | Jake | Outlook - Calandaring | 0 | January 21st 06 02:11 PM |