Become a Columnist Microsoft Exchange Site Microsoft Support SiteMSDN Exchange Site

   

Subscribe to OutlookExchange
Anderson Patricio
Ann Mc Donough
Bob Spurzem
Brian Veal
Catherine Creary
Cherry Beado
Colin Janssen
Collins Timothy Mutesaria
Drew Nicholson
Fred Volking
Glen Scales
Goran Husman
Guy Thomas
Henrik Walther
Jason Sherry
Jayme Bowers
John Young
Joyce Tang
Justin Braun
Konstantin Zheludev
Kristina Waters
Kuang Zhang
Mahmoud Magdy
Martin Tuip
Michael Dong
Michele Deo
Mitch Tulloch
Nicolas Blank
Pavel Nagaev
Ragnar Harper
Ricardo Silva
Richard Wakeman
Russ Iuliano
Santhosh Hanumanthappa
Steve Bryant
Steve Craig
Todd Walker
Tracey J. Rosenblath
 
 

Word 97 Class Module to Post document to folder w/o UI

Attached is a Word 97 class module that will post a Word document to a MAPI folder, without displaying a user interface. With a little effort you should be able to post any Office document to a folder. Also, you should be able to use this in any VBA environment, for example Excel 97, VB 5.0. NOTE: In VB 5.0 you will need to use a reference to an office library (Word) or the Office Compatible library. NOTE: It makes use of Active Messaging 1.1, so you will need a reference to this library in your project.

'
' Routine to test posting a document
'

Sub TestPostedDocument()
Dim pd As New PostedDocument
Set pd.Document = ActiveDocument
' put into a public folder, using full path
pd.FolderPath = "\Public Folders\All Public Folders\Documents"
' put into users mailbox, using relative path
pd.FolderPath = "Test"
If pd.Post Then
Debug.Print "Document posted"
Else
Debug.Print "Document not posted!"
End If
End Sub

zip.gif
Download Posted.Zip


Disclaimer: Your use of the information contained in these pages is at your sole risk. All information on these pages is provided "as is", without any warranty, whether express or implied, of its accuracy, completeness, fitness for a particular purpose, title or non-infringement, and none of the third-party products or information mentioned in the work are authored, recommended, supported or guaranteed by Stephen Bryant or Pro Exchange. OutlookExchange.Com, Stephen Bryant and Pro Exchange shall not be liable for any damages you may sustain by using this information, whether direct, indirect, special, incidental or consequential, even if it has been advised of the possibility of such damages.

Copyright Stephen Bryant 2008