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.
 

Victor Delta

Senior Member
Outlook version
Outlook 2021 64 bit
Email Account
POP3
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...?
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
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.
 

Victor Delta

Senior Member
Outlook version
Outlook 2021 64 bit
Email Account
POP3
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!!!
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
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.
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
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
 

Victor Delta

Senior Member
Outlook version
Outlook 2021 64 bit
Email Account
POP3
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.
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
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.
 

Victor Delta

Senior Member
Outlook version
Outlook 2021 64 bit
Email Account
POP3
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).
 

Victor Delta

Senior Member
Outlook version
Outlook 2021 64 bit
Email Account
POP3
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.
 

Victor Delta

Senior Member
Outlook version
Outlook 2021 64 bit
Email Account
POP3
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
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
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
 

Victor Delta

Senior Member
Outlook version
Outlook 2021 64 bit
Email Account
POP3
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
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
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.
 

Victor Delta

Senior Member
Outlook version
Outlook 2021 64 bit
Email Account
POP3
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?
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
It's not exposed in the object model, so you'd need to use sendkeys.
 

Victor Delta

Senior Member
Outlook version
Outlook 2021 64 bit
Email Account
POP3
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.
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
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
S Outlook 365 Help me create a Macro to make some received emails into tasks? Outlook VBA and Custom Forms 0
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 10
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
S Macro to extract email addresses of recipients in current drafted email and put into clipboard Outlook VBA and Custom Forms 2
witzker Macro to move @domain.xx of a Spammail to Blacklist in Outlook 2019 Outlook VBA and Custom Forms 7
S Macro for other actions - Outlook 2007 Outlook VBA and Custom Forms 23
C Macro to extract sender name & subject line of incoming emails to single txt file Outlook VBA and Custom Forms 3
L Macro/VBA to Reply All, with the original attachments Outlook VBA and Custom Forms 2
S Macro to move “Re:” & “FWD:” email recieved the shared inbox to a subfolder in outlook Outlook VBA and Custom Forms 0
S Outlook Macro to send auto acknowledge mail only to new mails received to a specific shared inbox Outlook VBA and Custom Forms 0
S Outlook Macro to move reply mail based on the key word in the subjectline Outlook VBA and Custom Forms 0
S Macro or plug-in to see if specific person was included in this email Outlook VBA and Custom Forms 4
U Macro for reminders,tasks,calendar Outlook VBA and Custom Forms 4
V macro runs slower on startup than after Outlook VBA and Custom Forms 3
N Macro to move all recipients to CC while replying Outlook VBA and Custom Forms 0
A VBA macro for 15 second loop in send and received just for 1 specific mailbox Outlook VBA and Custom Forms 1
G VBA Macro Using Outlook 4
R Help Revising VBA macro to delete email over different time span Outlook VBA and Custom Forms 0
M Outlook macro to automate search and forward process Outlook VBA and Custom Forms 6
R Macro Schedule every day in Outlook Using Outlook 0
L Moving emails with similar subject and find the timings between the emails using outlook VBA macro Outlook VBA and Custom Forms 1
Healy Consultants Macro to remove inside organization distribution list email address when reply to all recepients Outlook VBA and Custom Forms 0

Similar threads

Top