Probleme mit .saveas in netzwerkumgebung

J

Jörg Meier

Hallo NG,

ich greife von ACCESS mit VBA auf die aktuell geöffnete Email zu, bearbeite
sie und speichere die Email dann im Dateisystem ab.

Folgender Code (Auszug):

dim olmail as outlook.mailitem
dim dateiname as string
dim pfad as string
dim pfad1 as string
detiname = "test"
pfad1 = "D:\test\2005\"
olmail.saveas pfad1 & ".msg"

Alles funktioniert wunderbar !

pfad = "\\mun09\test\2005\
olmail.saveas pfad & ".msg"

wenn ich aber statt pfad1 (lokaler pfad) den pfad1 (netzwerk-pfad) nehme,
dann erhalte ich folgende Fehlermeldung:

Laufzeitfehler '-2147287037(800300003)':
Fehler beim Ausführen der Datei.

Wenn ich jedoch den pfad manuell anlege und die datei manuell in dem
verzeichnis abspeichere (manuell=im windows explorer), klappt alles. die
berechtigungen müssten also vorhanden sein.

an was liegt das?

wie kann ich das problem lösen?

Danke, Gruß Jörg
 
M

Michael Bauer

Hi Jörg,

this is an english speaking group.

I suppose the path in pfad isn´t the complete one. Because "test" seems
to be a folder, "mun09" maybe is the server name, there is the share
name missing.

In addition, though it won´t raise the error, you´ve declared a variable
for the file name, but you didn´t use it.
 
J

Jörg Meier

Sorry,

I didn´t know, that this is an english speaking NG.
I am sorry, the code has a mistake.

The following is the exact code. the problem is, that the procedure works
when i want to save the file local (pfad1).

dim olmail as outlook.mailitem
dim dateiname as string
dim pfad as string
dim pfad1 as string
dateiname = "test"
pfad1 = "D:\test\2005\"
olmail.saveas pfad1 & dateiname & ".msg"
pfad = "\\mun09\test\2005\
olmail.saveas pfad & dateiname & ".msg"

only if i want to save the mail to the network (pfad), then the problem
occurs.
I suppose the path in pfad isn´t the complete one. Because "test" seems
to be a folder, "mun09" maybe is the server name, there is the share
name missing.

what do you mean with share name?
normally, the mun09 is shared as z:\ disk. but there are some computers in
the network, on which the mun09 is w:\.
so i have to program it with the servername --> \\mun09\....
or is there another possibitlity ?


Thanks a lot

Joerg
 
M

Michael Bauer

Hi Jörg,

share name -> Freigabename. The full path must be:

\\servername\sharename\foldername\filename
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top