Copy a file to Outlook

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Would anyone know how to write a code to send a file to a "public folder" in
Outlook? The code would read:

Outlook.CopyFile "PathofFile","DestinationPath"

Any help on this would be appreciated. Thank you!
 
Sue,
Thanks so much, I've got the logic behind the code. But when I compile it
I'm getting a "Compile Error" "Sub or Function error" on [intLoc =
InStrRev(strFilePath, ".")] Any ideas?
 
Is this VBA code that you're writing? If so, what do you get if you enter this expression in the Immediate window:

? InStrRev("xyz\1234", "\")

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



MCyn said:
Sue,
Thanks so much, I've got the logic behind the code. But when I compile it
I'm getting a "Compile Error" "Sub or Function error" on [intLoc =
InStrRev(strFilePath, ".")] Any ideas?

Sue Mosher said:
You create a DocumentItem object and then attach the file to that item. See http://www.outlookcode.com/codedetail.aspx?id=712 for sample code.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Well I believe I'm getting the error because the code is reading "InStrRev"
as if it were calling a function or sub? Is this a function? I still get the
error: "Sub Or Function not defined"

Sue Mosher said:
Is this VBA code that you're writing? If so, what do you get if you enter this expression in the Immediate window:

? InStrRev("xyz\1234", "\")

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



MCyn said:
Sue,
Thanks so much, I've got the logic behind the code. But when I compile it
I'm getting a "Compile Error" "Sub or Function error" on [intLoc =
InStrRev(strFilePath, ".")] Any ideas?

Sue Mosher said:
You create a DocumentItem object and then attach the file to that item. See http://www.outlookcode.com/codedetail.aspx?id=712 for sample code.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Would anyone know how to write a code to send a file to a "public folder" in
Outlook? The code would read:

Outlook.CopyFile "PathofFile","DestinationPath"

Any help on this would be appreciated. Thank you!
 
It's a basic string handling function built into VBA/VB. That's why I asked what the code environment is.
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



MCyn said:
Well I believe I'm getting the error because the code is reading "InStrRev"
as if it were calling a function or sub? Is this a function? I still get the
error: "Sub Or Function not defined"

Sue Mosher said:
Is this VBA code that you're writing? If so, what do you get if you enter this expression in the Immediate window:

? InStrRev("xyz\1234", "\")

MCyn said:
Sue,
Thanks so much, I've got the logic behind the code. But when I compile it
I'm getting a "Compile Error" "Sub or Function error" on [intLoc =
InStrRev(strFilePath, ".")] Any ideas?

:

You create a DocumentItem object and then attach the file to that item. See http://www.outlookcode.com/codedetail.aspx?id=712 for sample code.

Would anyone know how to write a code to send a file to a "public folder" in
Outlook? The code would read:

Outlook.CopyFile "PathofFile","DestinationPath"

Any help on this would be appreciated. Thank you!
 
I really appreciate the help, I figured out the problem and what that
function was accomplishing. Thank you again for helping me with my problem,
it helped and I have it running.

Sue Mosher said:
It's a basic string handling function built into VBA/VB. That's why I asked what the code environment is.
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



MCyn said:
Well I believe I'm getting the error because the code is reading "InStrRev"
as if it were calling a function or sub? Is this a function? I still get the
error: "Sub Or Function not defined"

Sue Mosher said:
Is this VBA code that you're writing? If so, what do you get if you enter this expression in the Immediate window:

? InStrRev("xyz\1234", "\")

Sue,
Thanks so much, I've got the logic behind the code. But when I compile it
I'm getting a "Compile Error" "Sub or Function error" on [intLoc =
InStrRev(strFilePath, ".")] Any ideas?

:

You create a DocumentItem object and then attach the file to that item. See http://www.outlookcode.com/codedetail.aspx?id=712 for sample code.

Would anyone know how to write a code to send a file to a "public folder" in
Outlook? The code would read:

Outlook.CopyFile "PathofFile","DestinationPath"

Any help on this would be appreciated. Thank you!
 
Sue,
Sorry to bother you again, but would you happen to know how I would
automatically enter a mailbox folder instead of using the "objNS.PickFolder"
I want to add a folder (sub folder) of my "Inbox" folder. I'm currently using
Access 97 VBA coding.

Sue Mosher said:
It's a basic string handling function built into VBA/VB. That's why I asked what the code environment is.
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



MCyn said:
Well I believe I'm getting the error because the code is reading "InStrRev"
as if it were calling a function or sub? Is this a function? I still get the
error: "Sub Or Function not defined"

Sue Mosher said:
Is this VBA code that you're writing? If so, what do you get if you enter this expression in the Immediate window:

? InStrRev("xyz\1234", "\")

Sue,
Thanks so much, I've got the logic behind the code. But when I compile it
I'm getting a "Compile Error" "Sub or Function error" on [intLoc =
InStrRev(strFilePath, ".")] Any ideas?

:

You create a DocumentItem object and then attach the file to that item. See http://www.outlookcode.com/codedetail.aspx?id=712 for sample code.

Would anyone know how to write a code to send a file to a "public folder" in
Outlook? The code would read:

Outlook.CopyFile "PathofFile","DestinationPath"

Any help on this would be appreciated. Thank you!
 
Mcyn : you may using OL/tools/rules wizard to setup the rules you want your
incoming mail to be forward too.
 
Back
Top