Macro for 'Back' button

Status
Not open for further replies.

Victor Delta

Senior Member
Outlook version
Outlook 2021 64 bit
Email Account
POP3
I receive a lot of html emails with contents lists at the top that use hyperlink bookmarks. When using these I would often find it handy to have a 'back' button to enable me to jump back to the contents list. Using the 'customise' facility (in Outlook 2003) I thought I might be able to add a 'back' button but I cannot find one. I presume I therefore need an appropriate macro to which I can link a toolbar button. Can anyone please help me with such a macro. Many thanks.
 
It's even stranger than I thought because on the main Outlook interface there is a web toolbar (which, of course, includes a back button) but I cannot make it appear on the interface when I open a particular email (and it is not listed there either). Surely there must be a way of copying the button across from one toolbar to another...?
 
The web toolbar is only for the main window. I don't know of a way to do what you want - have you tried opening the message using View in browser? You'll have full use of all IE features. View in browser is on one of the menus in an open message.
 
The web toolbar is only for the main window. I don't know of a way to do what you want - have you tried opening the message using View in browser? You'll have full use of all IE features. View in browser is on one of the menus in an open message.

Many thanks for that Diane. Curiously I can't find the 'View in Browser' you refer to - I've got 'View in Internet Zone' but that doesn't appear to change much! However, in any case, I didn't really want to have to use another window and thought it would be relatively simple to create a macro which would add the 'back' functionality. How wrong I obviously was!!!
 
Hmm. I thought 2003 was the first version that had it but lost my virtual machines in a crash and couldn't double check. They switched from view in internet zone to view in browser.

I can't recall if there is a shortcut for back to top, but that is what you need. I'll check on it.
 
Try the home key on your keyboard (don't know why I didn't remember that key before)... shift + space is back when you use single key reading, but its a 'page' at a time
 
Diane, Many thanks - that's excellent. Just one thing I tried to write a macro to cover this (to enable the back button) but it doesn't seem to work (I created it in Word so perhaps it uses a different VBA syntax from Outlook?) The business line is Selection.HomeKey Unit:=wdLine - have I done something stupid? Thanks again.
 
Word macros work, but need tweaked a little to work in outlook, and you need to use word as your email editor, of course. You need to declare the word object model and it should work....

The macro at http://www.slipstick.com/developer/code-samples/insert-attachment-names-replying/ should give you an idea of what you need to declare and set. I'm on the road and can't take a look at it right now, but if you can't figure it out, I'll look at it tonight.
 
Looked at the link but was rather out of my depth. Sorry, but I think I'm going to need a little more of your help on this please. And, yes, I do use Word as my email editor. Thanks (and no hurry by the way).
 
I've ticked the MS Word 11 Object Library in References but the debugger still doesn't like my Selection.HomeKey. Can you point me in the right direction please. I'm not sure what I need to declare in the first line or two. Many thanks.
 
I'm on the road and can't take a look at it right now, but if you can't figure it out, I'll look at it tonight.

Diane, Sorry but I'm afraid I really do need your help on this! I've tried everything I can think of! Thanks, V
 
Dang, the code won't work in Outlook 2003 - i forgot reading html messages don't use word, it uses IE.

As an FYI, this is the code and it works in 2013, but not in 2003.

Code:
Sub MoveUp() 
 
Dim Item As Outlook.MailItem 
 
Dim olInspector As Outlook.Inspector 
 
Dim olDocument As Word.Document 
 
Dim olSelection As Word.Selection 
 
Set olInspector = Application.ActiveInspector() 
 
Set olDocument = olInspector.WordEditor 
 
Set olSelection = olDocument.Application.Selection 
 
olSelection.MoveUp Unit:=wdScreen, Count:=1 
 
End Sub
 
Dang, the code won't work in Outlook 2003 - i forgot reading html messages don't use word, it uses IE.

As an FYI, this is the code and it works in 2013, but not in 2003.

Code:
Sub MoveUp() 
 
Dim Item As Outlook.MailItem 
 
Dim olInspector As Outlook.Inspector 
 
Dim olDocument As Word.Document 
 
Dim olSelection As Word.Selection 
 
Set olInspector = Application.ActiveInspector() 
 
Set olDocument = olInspector.WordEditor 
 
Set olSelection = olDocument.Application.Selection 
 
olSelection.MoveUp Unit:=wdScreen, Count:=1 
 
End Sub

Hi Diane, Thank you so much for that although do I therefore assume there is no further way forward? It seems almost unbelievable that one cannot create an Outlook 2003 macro which simply mimics pressing the Home key. (Although I do use Word as my Outlook editor, I only went down the route of trying to create the macro in Word because it seemed easier than trying to write the vba code direct.) V
 
Well, the problem is that word macros work in outlook when word is the email editor, but unless you use RTF message format and select the option to read rtf messages in Word, you're not using word to read messages, outlook 2003 uses the IE rendering engine for HTML email.
 
Well, the problem is that word macros work in outlook when word is the email editor, but unless you use RTF message format and select the option to read rtf messages in Word, you're not using word to read messages, outlook 2003 uses the IE rendering engine for HTML email.

Thanks, yes but can't one create a non-Word macro in Outlook to simulate pressing the Home key?
 
It's not exposed in the object model, so you'd need to use sendkeys.
 
Thanks - never heard of SendKeys before! However, a macro with just - Interaction.SendKeys ("{HOME}") - seems to do exactly what I wanted, both with html and non-html emails. Mission accomplished - thanks again.
 
Cool. For some reason, I thought you'd already tried sendkeys, but I obviously mixed you up with another person I'm helping - and where send keys doesn't work. :(
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
Witzker HowTo start a macro with an Button in OL contact form Outlook VBA and Custom Forms 12
Eike Move mails via macro triggered by the click of a button? Outlook VBA and Custom Forms 0
Tanja Östrand Outlook 2016 - Create Macro button to add text in Subject Outlook VBA and Custom Forms 1
R Macro button name Normal.NewMacros.UK instead of UK Outlook VBA and Custom Forms 1
X Custom icon (not from Office 365) for a macro in Outlook Outlook VBA and Custom Forms 1
X Run macro automatically when a mail appears in the sent folder Using Outlook 5
mrrobski68 Issue with Find messages in a conversation macro Outlook VBA and Custom Forms 1
G Creating Macro to scrape emails from calendar invite body Outlook VBA and Custom Forms 6
M Use Macro to change account settings Outlook VBA and Custom Forms 0
J Macro to Reply to Emails w/ Template Outlook VBA and Custom Forms 3
C Outlook - Macro to block senders domain - Macro Fix Outlook VBA and Custom Forms 1
Witzker Outlook 2019 Macro to seach in all contact Folders for marked Email Adress Outlook VBA and Custom Forms 1
S macro error 4605 Outlook VBA and Custom Forms 0
A Macro Mail Alert Using Outlook 4
J Outlook 365 Outlook Macro to Sort emails by column "Received" to view the latest email received Outlook VBA and Custom Forms 0
J Macro to send email as alias Outlook VBA and Custom Forms 0
M Outlook Macro to save as Email with a file name format : Date_Timestamp_Sender initial_Email subject Outlook VBA and Custom Forms 0
Witzker Outlook 2019 Macro GoTo user defined search folder Outlook VBA and Custom Forms 6
D Outlook 2016 Creating an outlook Macro to select and approve Outlook VBA and Custom Forms 0
Witzker Outlook 2019 Macro to send an Email Template from User Defined Contact Form Outlook VBA and Custom Forms 0
Witzker Outlook 2019 Macro to check Cursor & Focus position Outlook VBA and Custom Forms 8
V Macro to mark email with a Category Outlook VBA and Custom Forms 4
M Outlook 2019 Macro not working Outlook VBA and Custom Forms 0
S Outlook 365 Help me create a Macro to make some received emails into tasks? Outlook VBA and Custom Forms 1
Geldner Send / Receive a particular group via macro or single keypress Using Outlook 1
D Auto Remove [EXTERNAL] from subject - Issue with Macro Using Outlook 21
V Macro to count flagged messages? Using Outlook 2
sophievldn Looking for a macro that moves completed items from subfolders to other subfolder Outlook VBA and Custom Forms 7
S Outlook Macro for [Date][Subject] Using Outlook 1
E Outlook - Macro - send list of Tasks which are not finished Outlook VBA and Custom Forms 3
E Macro to block senders domain Outlook VBA and Custom Forms 1
D VBA Macro to Print and Save email to network location Outlook VBA and Custom Forms 1
N VBA Macro To Save Emails Outlook VBA and Custom Forms 1
N Line to move origEmail to subfolder within a reply macro Outlook VBA and Custom Forms 0
Witzker Outlook 2019 Macro to answer a mail with attachments Outlook VBA and Custom Forms 2
A Outlook 2016 Macro to Reply, ReplyAll, or Forward(but with composing new email) Outlook VBA and Custom Forms 0
J Macro to Insert a Calendar Outlook VBA and Custom Forms 8
W Macro to Filter Based on Latest Email Outlook VBA and Custom Forms 6
T Macro to move reply and original message to folder Outlook VBA and Custom Forms 6
D Autosort macro for items in a view Outlook VBA and Custom Forms 2
S HTML to Plain Text Macro - Help Outlook VBA and Custom Forms 1
A Macro to file emails into subfolder based on subject line Outlook VBA and Custom Forms 1
N Help creating a VBA macro with conditional formatting to change the font color of all external emails to red Outlook VBA and Custom Forms 5
S Visual indicator of a certain property or to show a macro toggle Outlook VBA and Custom Forms 2
L Modifying VBA script to delay running macro Outlook VBA and Custom Forms 3
S Macro to extract and modify links from emails Outlook VBA and Custom Forms 3
M Replyall macro with template and auto insert receptens Outlook VBA and Custom Forms 1
L Macro to add Date & Time etc to "drag to save" e-mails Outlook VBA and Custom Forms 17
S Macro for Loop through outlook unread emails Outlook VBA and Custom Forms 2
Globalforester ItemAdd Macro - multiple emails Outlook VBA and Custom Forms 3

Similar threads

Back
Top