Visual Basic para Aplicaciones - Mensaje de avido al usar la funcion saveas desde u

Life is soft - evento anual de software empresarial
 
Vista:

Mensaje de avido al usar la funcion saveas desde u

Publicado por David (4 intervenciones) el 29/11/2007 13:29:37
Muy buenas.

En mi empresa tenemos unas macros creadas en las versiones 2000 del Office que estamos migrando a la version 2003 del Office.

Con el Word y el Excel no tengo problemas, pero cuando intento ejecutarlas en el Outlook 2003 me da el siguiente mensaje:

Un programa esta intentando obtener acceso a datos de Outlook que incluye la Libreta de direcciones. ¿Desea permitirlo?...

Lo unico que hace la macro es guardar el correo seleccionado en el disco duro del usuario.

¿Alguien sabe como quitar dicho mensaje?

He probado a bajar la seguridad y tampoco funciona.

Gracias de anemano
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Mensaje de avido al usar la funcion saveas desd

Publicado por David (4 intervenciones) el 03/12/2007 11:16:52
Bueno, pues me respondo a mi mismo.
En mi caso lo que necesitaba era guardar un mensaje seleccionado con formato .msg
En vez de usar:

Dim myItem As Object
Dim myOlApp As New Outlook.Application
Dim myOlExp As Outlook.Explorer
Dim myOlSel As Outlook.Selection

Set myOlExp = myOlApp.ActiveExplorer
Set myOlSel = myOlExp.Selection

For Each myItem In myOlSel
myItem.SaveAs "C:1.msg", olMSG
Next

Set myItem = Nothing
Set myOlApp = Nothing
Set myOlExp = Nothing
Set myOlSel = Nothing

uso lo siguiente:

Dim myItem As Object
Dim myOlApp As New Outlook.Application
Dim myOlExp As Outlook.Explorer
Dim myOlSel As Outlook.Selection

Set myOlExp = myOlApp.ActiveExplorer
Set myOlSel = myOlExp.Selection

For Each myItem In myOlSel
GuardarMensaje myItem, "C:1.msg", olMSG
Next

Set myItem = Nothing
Set myOlApp = Nothing
Set myOlExp = Nothing
Set myOlSel = Nothing

Sub GuardarMensaje(MyMail As MailItem, Nombre As String, Tipo As String)
Dim strID As String
Dim olNS As Outlook.NameSpace
Dim oMail As Outlook.MailItem

strID = MyMail.EntryID
Set olNS = Application.GetNamespace("MAPI")
Set oMail = olNS.GetItemFromID(strID)
oMail.SaveAs Nombre, Tipo

Set oMail = Nothing
Set olNS = Nothing
End Sub

Espero le sirva a alguien
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar