Using post VBA control with exel doc and public folders

Using post VBA control with exel doc and public folders

Post by Kevin LaFollett » Thu, 18 Sep 1997 04:00:00



I'm trying to write a VBA macro within Excel 97 that will post an Excel
workbook to a specific Exchange 5.0 public folder on a button push.  The
Exchange client I'm using is Outlook 97 v8.01

The control "ActiveWorkbook.Post()" brings up a dialog box from which you
can select the desired public folder, but I want to have the post
automatically go to a specific pre-defined folder.  No syntax for the
(expression) seems to work as a folder name.

I tried using ActiveWorkbook.SendMail Recipients:="Pub Fldr".  This works
fine to mail the Excel document to the folder, but won't allow me to tie in
user-defined document properties from the spreadsheet as columns within the
public folder.  This seems to be due to the attached file format of the
"SendMail" command embedding the Excel file in a message form, as apposed
to the posting being the document itself.

Any ideas?  Anything different coming in Exchange 5.5? or is this an issue
with VBA?

Kevin LaFollette
EMO

630-548-4236

 
 
 

Using post VBA control with exel doc and public folders

Post by Jay B. Harlow [MVP-Outlook » Fri, 19 Sep 1997 04:00:00


Kevin,
  Look at the PostedDocument class module on
<http://www.outlook.useast.com/outlook/>. This is a Word 97 class module,
but should be easily converted to Excel 97. Replace Word.Document with
Excel.Workbook... I left a few hints in the member...

It posts an office document to a public folder without a User Interface.

Known issues with the code:
1. "\Public Folders\All Public Folders" is not found, for "All Public
Folders", you need to use a for loop to find the correct one.
2. TrimExtension can have a problem if the file is saved without an
extension.
3. The document is assumed to be saved, The 'Post' method should fail if
document is not saved, or should save the document.
4. Page faults in 'AddKeywords' if Keywords is empty, should add check
5. Should use m_doc.Name as the display name for the attachment, Use:
    With m_msg
        .Attachments.Add m_doc.Name, 0, ActMsgFileData, m_doc.FullName
    End With

Hope this helps
Jay



> I'm trying to write a VBA macro within Excel 97 that will post an Excel
> workbook to a specific Exchange 5.0 public folder on a button push.  The
> Exchange client I'm using is Outlook 97 v8.01

> The control "ActiveWorkbook.Post()" brings up a dialog box from which you
> can select the desired public folder, but I want to have the post
> automatically go to a specific pre-defined folder.  No syntax for the
> (expression) seems to work as a folder name.

> I tried using ActiveWorkbook.SendMail Recipients:="Pub Fldr".  This works
> fine to mail the Excel document to the folder, but won't allow me to tie
in
> user-defined document properties from the spreadsheet as columns within
the
> public folder.  This seems to be due to the attached file format of the
> "SendMail" command embedding the Excel file in a message form, as apposed
> to the posting being the document itself.

> Any ideas?  Anything different coming in Exchange 5.5? or is this an
issue
> with VBA?

> Kevin LaFollette
> EMO

> 630-548-4236


 
 
 

1. Post Word Doc to Public Folder

Hi all!

Can anyone tell me how (if) I programmatically can preset which public
folder on Exchange to post a document??

If I use the Post method of the Document object I have to browse for the
folder but I want to hard code the folder address.

Thanx in advance
Jesper

2. Transcender Tests Trade

3. Agent Script to Delete Non MS-Word Doc Posts to Public Folder

4. Exchange Froze with no error

5. Can't post to public folders Using Netscape Collabra 4.05 ( NNTP access to public folders )

6. Error: 550 Mail barred

7. Exchange Queued Messages / Deferred Delivery

8. Can't post to public folders Using Netscape Messenger ( NNTP access to public folders )

9. Using Contact Public Folder in VBA