Sorry, but I don't understand what you're trying to accomplish with this code. Maybe you could give us an overview?
i get an error saying that if i want to save my changes i should take "save as".
This is perfectly normal if you opened an attachment from the reading pane. Such an attachment is always read-only. Therefore, if you want to save the changes, you must tell Outlook where you want to save them in the file system.
--
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 message ups.com...
Sorry about the double post i forgot i answered already and it didn't
show.
i have some code sample :
Private Sub objDocumentItem_BeforeAttachmentPreview(ByVal Attachment
As Outlook.Attachment, ByRef Cancel As Boolean)
preview = True 'This event will be triggered if the preview 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
If basLocking.IsLockedDocument(olParent, strUserName) Then
preview = False 'if the document is locked it means that
someone is busy with it
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
'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
End if
preview = false
end sub
This code works like it should
Only problem is every time when i want to edit a document (so
doubleclick on it)
i get an error saying that if i want to save my changes i should take
"save as".
The first time the document won't open. but the second time i try it.
It opens and i can start editing.
When i save it Outlook crashes and wants to restart itself so i have
no other option then to do that.
Anyone has some suggestions?
Maybe it's best to just turn the preview pane off if it's a document?
but how do i do that in code???
On Jul 17, 9:46 am, _-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
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?