Programmatically posting to a specific Exchange public folder 
Author Message
 Programmatically posting to a specific Exchange public folder

Is there a way to post a Word document or an Excel workbook to a specific Exchange public folder w/o having the dialog box pop up prompting the user for the destination folder?

TIA,
Bill Youngman



Mon, 29 Mar 2004 22:55:07 GMT  
 Programmatically posting to a specific Exchange public folder

Hi Bill,

I think this is the kind of thing you're looking for

Private Sub PostPublic(ByRef wbkX As Excel.Workbook)
Dim objOutl As Outlook.Application
Dim objNS As Outlook.Namespace
Dim objFolder As Outlook.MAPIFolder
Dim objOLitem As Outlook.PostItem
    Set objOutl = New Outlook.Application
    Set objNS = objOutl.GetNamespace("MAPI")
    Set objFolder = objNS.Folders("Public Folders")
    Set objFolder = objFolder.Folders("All Public Folders")

    ' work down to the relevant folder
    Set objFolder = objFolder.Folders("Public Folder 1")
    Set objFolder = objFolder.Folders("Public Folder 2")
    Set objFolder = objFolder.Folders("Public Folder 3")

    With objFolder.Items.Add(olPostItem)
      .Subject = wbkX.Name
      .Attachments.Add wbkX.FullName
      .Post
    End With
    wbkX.Close savechanges:=False
End Sub

You will, of course need a reference to Outlook

HTH

Alan P.

  Is there a way to post a Word document or an Excel workbook to a specific Exchange public folder w/o having the dialog box pop up prompting the user for the destination folder?

  TIA,
  Bill Youngman



Tue, 30 Mar 2004 01:11:15 GMT  
 Programmatically posting to a specific Exchange public folder
hi,

interesting, because I have the same problem.
but is it also possible, to post it directly into the folder (without being
an attachment)?

thanks & ciao
jrgen.



Hi Bill,

I think this is the kind of thing you're looking for

Private Sub PostPublic(ByRef wbkX As Excel.Workbook)
Dim objOutl As Outlook.Application
Dim objNS As Outlook.Namespace
Dim objFolder As Outlook.MAPIFolder
Dim objOLitem As Outlook.PostItem
    Set objOutl = New Outlook.Application
    Set objNS = objOutl.GetNamespace("MAPI")
    Set objFolder = objNS.Folders("Public Folders")
    Set objFolder = objFolder.Folders("All Public Folders")

    ' work down to the relevant folder
    Set objFolder = objFolder.Folders("Public Folder 1")
    Set objFolder = objFolder.Folders("Public Folder 2")
    Set objFolder = objFolder.Folders("Public Folder 3")

    With objFolder.Items.Add(olPostItem)
      .Subject = wbkX.Name
      .Attachments.Add wbkX.FullName
      .Post
    End With
    wbkX.Close savechanges:=False
End Sub

You will, of course need a reference to Outlook

HTH

Alan P.

Is there a way to post a Word document or an Excel workbook to a specific
Exchange public folder w/o having the dialog box pop up prompting the user
for the destination folder?

TIA,
Bill Youngman



Thu, 01 Apr 2004 05:51:54 GMT  
 Programmatically posting to a specific Exchange public folder
Yes...

' This is just part of an Outlook 2000/2002 VBA macro
Set objFolder = Application.ActiveExplorer.CurrentFolder
Set colItems = objFolder.Items

Set objDocument = colItems.Add ("IPM.Document.Word.Document.8")

' strFilePath is a string variable that holds the path/filename information
objDocument.Attachments.Add strFilePath
objDocument.Subject = "A Word Document"

' Must set the message class explicitly for Word documents
objDocument.MessageClass = "IPM.Document.Word.Document.8"
objDocument.Save

objDocument.Display

set objDocument = Nothing


Quote:
> hi,

> interesting, because I have the same problem.
> but is it also possible, to post it directly into the folder (without
being
> an attachment)?

> thanks & ciao
> jrgen.



> Hi Bill,

> I think this is the kind of thing you're looking for

> Private Sub PostPublic(ByRef wbkX As Excel.Workbook)
> Dim objOutl As Outlook.Application
> Dim objNS As Outlook.Namespace
> Dim objFolder As Outlook.MAPIFolder
> Dim objOLitem As Outlook.PostItem
>     Set objOutl = New Outlook.Application
>     Set objNS = objOutl.GetNamespace("MAPI")
>     Set objFolder = objNS.Folders("Public Folders")
>     Set objFolder = objFolder.Folders("All Public Folders")

>     ' work down to the relevant folder
>     Set objFolder = objFolder.Folders("Public Folder 1")
>     Set objFolder = objFolder.Folders("Public Folder 2")
>     Set objFolder = objFolder.Folders("Public Folder 3")

>     With objFolder.Items.Add(olPostItem)
>       .Subject = wbkX.Name
>       .Attachments.Add wbkX.FullName
>       .Post
>     End With
>     wbkX.Close savechanges:=False
> End Sub

> You will, of course need a reference to Outlook

> HTH

> Alan P.


> Is there a way to post a Word document or an Excel workbook to a specific
> Exchange public folder w/o having the dialog box pop up prompting the user
> for the destination folder?

> TIA,
> Bill Youngman



Thu, 01 Apr 2004 06:32:54 GMT  
 Programmatically posting to a specific Exchange public folder
great, thanks
jrgen



Quote:
> Yes...

> ' This is just part of an Outlook 2000/2002 VBA macro
> Set objFolder = Application.ActiveExplorer.CurrentFolder
> Set colItems = objFolder.Items

> Set objDocument = colItems.Add ("IPM.Document.Word.Document.8")

> ' strFilePath is a string variable that holds the path/filename
information
> objDocument.Attachments.Add strFilePath
> objDocument.Subject = "A Word Document"

> ' Must set the message class explicitly for Word documents
> objDocument.MessageClass = "IPM.Document.Word.Document.8"
> objDocument.Save

> objDocument.Display

> set objDocument = Nothing



> > hi,

> > interesting, because I have the same problem.
> > but is it also possible, to post it directly into the folder (without
> being
> > an attachment)?

> > thanks & ciao
> > jrgen.



> > Hi Bill,

> > I think this is the kind of thing you're looking for

> > Private Sub PostPublic(ByRef wbkX As Excel.Workbook)
> > Dim objOutl As Outlook.Application
> > Dim objNS As Outlook.Namespace
> > Dim objFolder As Outlook.MAPIFolder
> > Dim objOLitem As Outlook.PostItem
> >     Set objOutl = New Outlook.Application
> >     Set objNS = objOutl.GetNamespace("MAPI")
> >     Set objFolder = objNS.Folders("Public Folders")
> >     Set objFolder = objFolder.Folders("All Public Folders")

> >     ' work down to the relevant folder
> >     Set objFolder = objFolder.Folders("Public Folder 1")
> >     Set objFolder = objFolder.Folders("Public Folder 2")
> >     Set objFolder = objFolder.Folders("Public Folder 3")

> >     With objFolder.Items.Add(olPostItem)
> >       .Subject = wbkX.Name
> >       .Attachments.Add wbkX.FullName
> >       .Post
> >     End With
> >     wbkX.Close savechanges:=False
> > End Sub

> > You will, of course need a reference to Outlook

> > HTH

> > Alan P.


> > Is there a way to post a Word document or an Excel workbook to a
specific
> > Exchange public folder w/o having the dialog box pop up prompting the
user
> > for the destination folder?

> > TIA,
> > Bill Youngman



Thu, 01 Apr 2004 14:28:07 GMT  
 Programmatically posting to a specific Exchange public folder
Thanks, that's exactly what I was looking for.



Quote:
> Yes...

> ' This is just part of an Outlook 2000/2002 VBA macro
> Set objFolder = Application.ActiveExplorer.CurrentFolder
> Set colItems = objFolder.Items

> Set objDocument = colItems.Add ("IPM.Document.Word.Document.8")

> ' strFilePath is a string variable that holds the path/filename
information
> objDocument.Attachments.Add strFilePath
> objDocument.Subject = "A Word Document"

> ' Must set the message class explicitly for Word documents
> objDocument.MessageClass = "IPM.Document.Word.Document.8"
> objDocument.Save

> objDocument.Display

> set objDocument = Nothing



> > hi,

> > interesting, because I have the same problem.
> > but is it also possible, to post it directly into the folder (without
> being
> > an attachment)?

> > thanks & ciao
> > jrgen.



> > Hi Bill,

> > I think this is the kind of thing you're looking for

> > Private Sub PostPublic(ByRef wbkX As Excel.Workbook)
> > Dim objOutl As Outlook.Application
> > Dim objNS As Outlook.Namespace
> > Dim objFolder As Outlook.MAPIFolder
> > Dim objOLitem As Outlook.PostItem
> >     Set objOutl = New Outlook.Application
> >     Set objNS = objOutl.GetNamespace("MAPI")
> >     Set objFolder = objNS.Folders("Public Folders")
> >     Set objFolder = objFolder.Folders("All Public Folders")

> >     ' work down to the relevant folder
> >     Set objFolder = objFolder.Folders("Public Folder 1")
> >     Set objFolder = objFolder.Folders("Public Folder 2")
> >     Set objFolder = objFolder.Folders("Public Folder 3")

> >     With objFolder.Items.Add(olPostItem)
> >       .Subject = wbkX.Name
> >       .Attachments.Add wbkX.FullName
> >       .Post
> >     End With
> >     wbkX.Close savechanges:=False
> > End Sub

> > You will, of course need a reference to Outlook

> > HTH

> > Alan P.


> > Is there a way to post a Word document or an Excel workbook to a
specific
> > Exchange public folder w/o having the dialog box pop up prompting the
user
> > for the destination folder?

> > TIA,
> > Bill Youngman



Sat, 03 Apr 2004 03:46:14 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Programmatically post a .ppt file to an Exchange public folder

2. Programmatically posting Excel spreadsheet to Exchange Public Folder

3. Post to a specific Public Folder using CDO

4. Creating a post to a specific public folder

5. Programatically post to a specific public folder

6. Posting to Exchange Public Folder.

7. programmatically change the properties of a Exchange mailbox folder

8. moving emails to specific public folder

9. Exchange Public Folder as Recordset

10. Link Exchange Public folder to Access 97

11. From Acces97 to an Exchange public folder

12. Create Public Folder (use in Exchange)

 

 
Powered by phpBB® Forum Software