Open new outlook form from within existing outlook form using command button

Status
Not open for further replies.

Mja

Member
Outlook version
Outlook 2007
Email Account
Exchange Server
Hello all, I have an outlook form in 2007 that requires the user to approve/disapprove a request. Presently, I have it setup for the user to choose approve or disapprove from the toolbar custom actions tab. This works well and opens another outlook form relative to their choice. What I would like to do is have the user click a command button in the form that will then open the approved or disapproved form. I hope this is clear and do appreciate any assistance. I did try the following code but it produces a generic error: Object Required. CmdApproval_Click() Item.Actions("Approval Form").Execute End Sub R/Michael
 

Forum Admin

Senior Member
Re: Open new outlook form from within existing outlook form using command butt

Have not tested this.... if you can't open the form from the click, you may need to use 2 macros, the click macro that calls the open form macro.




Code:

 
 
Sub CommandButton1_Click()  
  Set Item = Items.Add("ipm.note.name") 
  Item.Display 
 
 
End Sub







If you need to open a template (oft) instead, code samples are at How to Open Outlook Templates and Files using Toolbar Buttons
 

Mja

Member
Outlook version
Outlook 2007
Email Account
Exchange Server
Re: Open new outlook form from within existing outlook form using command butt

Hi,

I tried to execute the code sample you gave but I still got the object required error. So I went to the website you recommended and I was able to piece together some code (see below) and get the form to open but it does not carry over any message or attachments as would be the case in a forward action. Do you have any idea why this may occur? If I select the the form from the custom actions in the toolbar the message and attachment is present. Thanks for helping. Mja

Code:
Sub CmdApproveSendToBudget_Click
   strForm = "IPM.Note.Request Budget Approval V1"
     Set objFolder = _
       Application.ActiveExplorer.CurrentFolder
     Set objItem = _
       objFolder.Items.Add(strForm)
     objItem.Display
   Item.Close 1 
 
End Sub
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
Re: Open new outlook form from within existing outlook form using command butt

You need to pick up the body - I don't see code that refereces the old message, but it would go something like

objItem.Body = objOldMsg.Body

Attachments are a little more difficult - you need to use windows scripting to get them. But i have code... you need the copyattachment function from Reply or ReplyAll with Attachments - Slipstick Systems - that page should also point you in the right direction for identifying the original message so you can get the body from it.
 

Mja

Member
Outlook version
Outlook 2007
Email Account
Exchange Server
Re: Open new outlook form from within existing outlook form using command butt

You need to pick up the body - I don't see code that refereces the old message, but it would go something like objItem.Body = objOldMsg.Body Attachments are a little more difficult - you need to use windows scripting to get them. But i have code... you need the copyattachment function from Reply or ReplyAll with Attachments - Slipstick Systems - that page should also point you in the right direction for identifying the original message so you can get the body from it.
Diane, Thank you for the hep on this. I have one more OT question please. Do you know how I can test if a user clicks the red X button on a form? Many thanks, Michael
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
J Outlook Forms 2010 Sent form will not open Using Outlook 1
M open outlook calendar from an access form Using Outlook 4
M open outlook contacts in access 2007 form Using Outlook 1
talla Can't open Outlook Item. Using Outlook 0
O Outlook on Android: after sharing / sending a news article, draft remains open. Why? Using Outlook 1
witzker Open Contact missing in Outlook 2019 Using Outlook 2
A How to open a specific link automatically with outlook 2016 Outlook VBA and Custom Forms 6
H Upon opening Outlook, make my popmail inbox open instead of outlook.com inbox Using Outlook 1
sahameed82 SharePoint calendar directly open in Outlook Using Outlook 0
C Outlook 2016/2019 hangs after being open for an extended period Using Outlook 4
J How to open OST file in Outlook 2019 & 2016 Using Outlook 1
C Can't Open Outlook 365 Using Outlook 0
M outlook won't open! Using Outlook 1
E Unable to open Outlook 2010 after adding new email account Using Outlook 4
J Open an outlook email by Subject on MS Access linked table with VBA Outlook VBA and Custom Forms 10
A How to open a specific link automatically with outlook Outlook VBA and Custom Forms 13
S Outlook 2010 Cannot Open Attachments Using Outlook 14
N open the hyperlink in Outlook directly instead of browser Using Outlook 1
S Outlook does not open the .pst file created by the Outlook Using Outlook 5
A open Outlook with multiple windows. Using Outlook 0
G Can't open .pst. Message could not access default folder (Outlook 2010 (.pst). Before that was backi Using Outlook 0
I Outlook 2010, 2013 will not open .msg or .eml files Using Outlook.com accounts in Outlook 1
Diane Poremsky Outlook VBA: Work with Open Item or Selected Item Using Outlook 0
O Windows 10 x64 Outlook 2013 - URL does not open (anymore) Using Outlook 3
Diane Poremsky Outlook 2013: Control Panel Mail Won't Open Using Outlook 0
Diane Poremsky Outlook Links Won't Open In Windows 10 Using Outlook 1
L Outlook 2013 won't open MS Office attachments Using Outlook 1
Diane Poremsky Open Shared Mailboxes in Outlook on the Web Using Outlook 0
V Cannot start Outlook. Cannot open the Outlook window. Using Outlook 8
O Outlook 2003 can't open contacts. Using Outlook 2
Z Outlook 2007, clicking email addresses fails to open Contact Using Outlook 0
G Outlook calendar entry corrupted. Constant pop up when you open outlook. Unable to delete or remove. Using Outlook 2
J Outlook won't open. PST file busy. Using Outlook 3
M Cannot start MS Office Outlook Cannot open the Outlook window Using Outlook 2
Gareth Outlook Task Will not open. Using Outlook 5
D Outlook VBA to open Excel attachment and send recipient's email address to a workbook cell? Using Outlook 4
M Can't open same msg file more than once at the same time in Outlook 2010 Using Outlook 7
B What is the best way to use Outlook address book to select customer and then open Excel Outlook VBA and Custom Forms 22
J VBS Script (macro) for word to open Outlook template. Outlook VBA and Custom Forms 2
F Cannot open extracted .msg files from outlook Outlook VBA and Custom Forms 1
L Trying to open contacts pst. file in outlook 365 Using Outlook 3
V Open Outlook Calendar and Tasks views with Folder pane off Using Outlook 2
L Outlook 2007 Open Folder From a Contact Using Outlook 22
B Add-in "always enabled" but Outlook 13 won't open Using Outlook 7
P open reminders missing after copying outlook pst file Using Outlook 2
L Outlook 2007 Macro Open Contact Folder Using Outlook 7
Lucas attachments in outlook don't open, when Icloud is connected Using Outlook 0
T Outlook 2010 Very Slow To Open Recently Using Outlook 9
W outlook refuses to open any attachments ... not related to shadow directory Using Outlook 2
M Disk Reads of outlook.pst while outlook not open Exchange Server Administration 1

Similar threads

Top