PDA

View Full Version : Run time error 462 the remote server machine does not exist or is unavailable



kenli87
08-18-2015, 01:38 AM
hi guys i have the following code:


Sub Kenneth_Li()
Dim objOL As Object
Dim Msg As Object


Set objOL = CreateObject("Outlook.Application")
inPath = "C:\Users\SiliconPlus\Desktop\Si+ Contact Lists\Contact_Si+"


thisFile = Dir(inPath & "\*.msg")
Do While thisFile <> ""


Set Msg = objOL.CreateItemFromTemplate(inPath & "\" & thisFile)
Msg.Display
Msg.Close olSave
thisFile = Dir
Loop




Set objOL = Nothing
Set Msg = Nothing
End Sub


what happens is that it proceeds to open the first .msg file and then close and save it, subsequently giving a run time error 462 the remote server does not exist. Please help me!

mancubus
08-18-2015, 11:18 PM
crossposted here:
http://stackoverflow.com/questions/30908788/opening-msg-outlook-file-using-vba-excel


crossposting etiquette:
http://www.excelguru.ca/content.php?184