piec2
asked on
Mail viewing and editing using a custom Post form
Here is what i need,
When i open a new mail message and i click Edit this Message, i want a post form that i have created to open. Is this in any way possible??? I found how to make Post in this Folder open my form but now i need my message to be in my custom form
When i open a new mail message and i click Edit this Message, i want a post form that i have created to open. Is this in any way possible??? I found how to make Post in this Folder open my form but now i need my message to be in my custom form
ASKER
Then would it be possible to modify an existing/original form to add an action?
I'm not sure, I've never tried, but I don't think you can edit the default forms. You can create your own form that's a knock-off of one ofthe original forms though and add your own fields, code, etc. What sort of action?
ASKER
What i want it to do is when i open a received message, i want there to be a button that when it is clicked it will open my form but have copied the text from the original message into my form.
piec2,
That's quite a bit different from what I thought you were looking for. That's doable with a bit of VBA. Something like this:
Sub ReplyWithCustomForm()
Dim olkMessage As Outlook.MailItem, _
olkCustom As Outlook.MailItem, _
olkFolder As Outlook.MAPIFolder
Set olkMessage = Application.ActiveInspecto r.CurrentI tem
'Change the folder path to that of a folder with your custom form
Set olkFolder = OpenMAPIFolder("\eeTesting \Jobs\Blah ")
'Change the form name to that of your form
Set olkCustom = olkFolder.Items.Add("IPM.N ote.MyCust omForm")
'Copy the message properties from the original message to your message. I'm only copying enough to give an example
olkCustom.Subject = olkMessage.Subject
olkCustom.BodyFormat = olkMessage.BodyFormat
olkCustom.Body = olkMessage.Body
olkCustom.HTMLBody = olkMessage.HTMLBody
olkCustom.Display
End Sub
'Credit where credit is due.
'The code below is not mine. I found it somewhere on the internet but do
'not remember where or who the author is. The original author(s) deserves all
'the credit for these functions.
Function OpenMAPIFolder(szPath)
Dim app, ns, flr, szDir, i
Set flr = Nothing
Set app = CreateObject("Outlook.Appl ication")
If Left(szPath, Len("\")) = "\" Then
szPath = Mid(szPath, Len("\") + 1)
Else
Set flr = app.ActiveExplorer.Current Folder
End If
While szPath <> ""
i = InStr(szPath, "\")
If i Then
szDir = Left(szPath, i - 1)
szPath = Mid(szPath, i + Len("\"))
Else
szDir = szPath
szPath = ""
End If
If IsNothing(flr) Then
Set ns = app.GetNamespace("MAPI")
Set flr = ns.Folders(szDir)
Else
Set flr = flr.Folders(szDir)
End If
Wend
Set OpenMAPIFolder = flr
End Function
Function IsNothing(Obj)
If TypeName(Obj) = "Nothing" Then
IsNothing = True
Else
IsNothing = False
End If
End Function
That's quite a bit different from what I thought you were looking for. That's doable with a bit of VBA. Something like this:
Sub ReplyWithCustomForm()
Dim olkMessage As Outlook.MailItem, _
olkCustom As Outlook.MailItem, _
olkFolder As Outlook.MAPIFolder
Set olkMessage = Application.ActiveInspecto
'Change the folder path to that of a folder with your custom form
Set olkFolder = OpenMAPIFolder("\eeTesting
'Change the form name to that of your form
Set olkCustom = olkFolder.Items.Add("IPM.N
'Copy the message properties from the original message to your message. I'm only copying enough to give an example
olkCustom.Subject = olkMessage.Subject
olkCustom.BodyFormat = olkMessage.BodyFormat
olkCustom.Body = olkMessage.Body
olkCustom.HTMLBody = olkMessage.HTMLBody
olkCustom.Display
End Sub
'Credit where credit is due.
'The code below is not mine. I found it somewhere on the internet but do
'not remember where or who the author is. The original author(s) deserves all
'the credit for these functions.
Function OpenMAPIFolder(szPath)
Dim app, ns, flr, szDir, i
Set flr = Nothing
Set app = CreateObject("Outlook.Appl
If Left(szPath, Len("\")) = "\" Then
szPath = Mid(szPath, Len("\") + 1)
Else
Set flr = app.ActiveExplorer.Current
End If
While szPath <> ""
i = InStr(szPath, "\")
If i Then
szDir = Left(szPath, i - 1)
szPath = Mid(szPath, i + Len("\"))
Else
szDir = szPath
szPath = ""
End If
If IsNothing(flr) Then
Set ns = app.GetNamespace("MAPI")
Set flr = ns.Folders(szDir)
Else
Set flr = flr.Folders(szDir)
End If
Wend
Set OpenMAPIFolder = flr
End Function
Function IsNothing(Obj)
If TypeName(Obj) = "Nothing" Then
IsNothing = True
Else
IsNothing = False
End If
End Function
ASKER
I understand the code but how do i add a button to my received message page.
Adding a button to the received message page on your form won't help. It'd be better to add a toolbar button that you can click. I say that for two reasons. First, adding a button to your form won't help with received items. They use a different form and you can't control them. Second, if you put the button your form, then you'd have to open a recieved message, then open your form, then click the button to transfer the contents of the received message to your form. It's simpler to click a button on the toolbar and have the last two parts of that done automatically.
Do you need instructions on adding a toolbar button?
Do you need instructions on adding a toolbar button?
ASKER
no i know how to add a toolbar button but im not getting how that would help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Ok i understand now, but now my problem is ive searched everywhere to enable macros and i cannot find it, How do i do that? also, i cannot find how to make my button use my macro, i need to assign a hyperlink right? but how do i find where my macro was saved? ive looked everywhere...
Help
Help
ASKER
Nevermind I found it... THANK YOU SO MUCH
You're welcome. Sorry I couldn't back to you earlier.
I don't believe it's possible to open a message created with one form and edit it using a different form.
Cheers!