View Single Post
  #9  
Old July 18th 07, 10:53 AM posted to microsoft.public.outlook.program_vba
_-Andy-_
external usenet poster
 
Posts: 10
Default Reading Pane in vba

Mm it seems that sometimes the reply doesn't get shown in the
discussiongroup or not that fast :s
i put a reply on yesterday
sorry if this will be the same post again.

i added some events that will be triggered

Private Sub objDocumentItem_BeforeAttachmentPreview(ByVal Attachment
As Outlook.Attachment, ByRef Cancel As Boolean)
preview = True 'This will get triggered if the preview pane /
reading pane is on.
End Sub

Private Sub objDocumentItem_BeforeAttachmentRead(ByVal Attachment As
Outlook.Attachment, ByRef Cancel As Boolean)
Dim strUserName As String
Dim olParent As Outlook.DocumentItem
Set olParent = Attachment.Parent
If preview Then 'This will get triggered between the
BeforeAttachmentPreview and AttachmentRead event. It will check if the
document is locked.
If basLocking.IsLockedDocument(olParent, strUserName) Then 'if
it's locked the locking mechanism will handle it
preview = False
End If
End If
End Sub

Private Sub objDocumentItem_AttachmentRead(ByVal Attachment As
Outlook.Attachment)
Dim intUserResponse As Integer
Dim strClass As String
Dim strUserName As String
Dim olParent As Outlook.DocumentItem
Dim rc As Long, h As Long
On Error GoTo ERROR_objDocumentItem_AttachmentRead
Set olParent = Attachment.Parent
strClass = olParent.MessageClass
If preview Then 'this works like it should i can see the preview
without the document being locked.
'It won't do anything special because it will be shown only so
it shouldn't be locked or unlocked.
Else
'Opens the document in Word or Excel and sets the locking
mechanism
'This will go off if the document is doubleclicked in Outlook.
'This will generate an error saying the file is already been
viewed by some application (Outlook)
'The second time i try to open a document it will open but i
still get an error saying that all changes will be lost if i don't
save as ...
'If i still save it on the original file it will save but
Outlook will crash :s
'I'm assuming this is because outlook had opened the file in
preview and it couldn't handle the new document being saved.
End if
preview = false
end sub

Maybe the best solution is to check if it's a document that is
selected and turn the preview / reading pane off and if it's a normal
email to turn the pane on.
But how do i do that?
I couldn't find that yet :s

Greetings,

Andy

On 17 jul, 09:46, _-Andy-_ wrote:
I use Outlook 2007
And i tried to disable the preview addin for some items but i get the
same effect.
The AttachmentRead event still gets triggered :shttps://msdn2.microsoft.com/en-us/library/aa209976(office.11).aspx
If you need more info let me know

On Jul 16, 9:36 pm, "Sue Mosher [MVP-Outlook]" wrote:
Outlook version?


--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"_-Andy-_" wrote in ooglegroups.com...
I need something else
How can i turn the Preview (Reading) Pane off and on?
Again i need to know how to call the ShowReadingPane method :s
Anyone please?


On Jul 16, 2:22 pm, _-Andy-_ wrote:
It seems that i found it
If Explorers.Item(1).IsPaneVisible(olPreview) = True Then


That's at least one possibility.
I use this for a locking mechanisme for files in public folders in
outlook.
But it locked also in preview mode :s
no it doesn't
but i can't lock it anymore now :s
It's in the event ReadAttachment
Is there an Event DoubleClick??


On Jul 16, 1:07 pm, _-Andy-_ wrote:


Hellow,
I want to check if the ReadingPane is On in vba.
How can i do this?
i found a method ShowReadingPane but i can't find an example on how to
use it.
It's supposed to be a part of a Tableview?
Anyone has some suggestions?
Thanks in advance- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -



Ads