From: ericb on

When i create a new contact from access in outlook sometime the outlook
window shows up and other times it is an icon on the desktop that shows up.
I then have to click the outlook icon and then the window opens.

What do i have to set so the window automatically appears and not the icon ?

This is how i 'm making my new contact :

Set item = OutlookApp.CreateItem(olContactItem)
item.FirstName = varPrenom & ""
item.LastName = varNom & ""
item.HomeAddressStreet = varAdresse & ""
item.HomeAddressCity = varVille & ""
item.HomeAddressState = varProv & ""
item.HomeAddressPostalCode = varCodePostal & ""
item.Email1Address = varEmail & ""
item.Display (True)

Thank you for the tip.
--
Eric
From: Jörn Bosse on
Well it depends on the window you want to see.
If you use ite.display, you´ll allways see the contact-window.

It would be interesting to know how yout whole code looks like.
I just wrote this little rocedure and i works good:

Public Function NewOutlookContact()
Dim outlookApp As Outlook.Application
Dim outlookCon As Outlook.ContactItem

Set outlookApp = CreateObject("Outlook.Application.12")
Set outlookCon = outlookApp.CreateItem(olContactItem)

outlookCon.Display

With outlookCon
.LastName = "Bernd"
.FirstName = "Bernd"
.BusinessAddressStreet = "test"
.BusinessAddressCity = "test"
.Email1Address = "Test(a)Test.de"
End With

MsgBox "New contact created"

Set outlookApp = Nothing
Set outlookCon = Nothing
End Function

When the import has finished outlook closes, but im´m not sure if this
really is what you want.
if you wand to open an application, you can use the shell-command:
shell "C:\Program Files\Microsoft Office\Office12\outlook.exe"

Jörn


 | 
Pages: 1
Prev: coucou
Next: Moving picture from folder