Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-21-2015, 05:46 AM
Nicobisgaard Nicobisgaard is offline Custom ribbon button or shortcut for a specific function Windows 7 64bit Custom ribbon button or shortcut for a specific function Office 2010 64bit
Novice
Custom ribbon button or shortcut for a specific function
 
Join Date: Apr 2015
Posts: 8
Nicobisgaard is on a distinguished road
Default Custom ribbon button or shortcut for a specific function

Hello,



I find myself doing the following a very large number of times:

1) I Click a cell in excel, press Ctrl + C to copy the content,
2) Enter word, press Paste special -> paste link: -> Unformatted text.

Is it possible to create either a ribbon button or a shortcut (would be ideal to have both) in MS word that will perform the second action with one click/shortcut?
This will save me alot of time.
Reply With Quote
  #2  
Old 04-21-2015, 06:18 AM
Charles Kenyon Charles Kenyon is offline Custom ribbon button or shortcut for a specific function Windows 8 Custom ribbon button or shortcut for a specific function Office 2013
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,125
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

Below is a macro that pastes unformatted text.

Code:
Sub PasteUnformatted()
'
' PasteUnformatted Macro
'
'
    Selection.PasteAndFormat (wdFormatPlainText)
End Sub

Installing Macros

You can attach a keyboard shortcut to this and a QAT button easily.
Modifying the QAT and Ribbon in Microsoft Word
Reply With Quote
  #3  
Old 04-21-2015, 07:31 AM
Nicobisgaard Nicobisgaard is offline Custom ribbon button or shortcut for a specific function Windows 7 64bit Custom ribbon button or shortcut for a specific function Office 2010 64bit
Novice
Custom ribbon button or shortcut for a specific function
 
Join Date: Apr 2015
Posts: 8
Nicobisgaard is on a distinguished road
Default

Ahh, The macro and shortcut part is very neat.

However the macro only copies the next, not the link that came with it. I tried to find solutions to what the macro command is for pasting unformatted text as a "paste link" not as paste without success. When i record the result is a macro that bugs.
Any ideas what this would be?
Reply With Quote
  #4  
Old 04-21-2015, 08:31 PM
Charles Kenyon Charles Kenyon is offline Custom ribbon button or shortcut for a specific function Windows 8 Custom ribbon button or shortcut for a specific function Office 2013
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,125
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

Well, that is what you said you wanted.


The following will paste a hyperlink, but carries other formatting with it.

Code:
Sub PasteHyperlink1()
'
' PasteHyperlink1 Macro
'
'
    Selection.PasteAndFormat (wdFormatOriginalFormatting)
End Sub
' or

Code:
Sub PasteHyperlink2()
'
' PasteHyperlink2 Macro
'
'
    Selection.PasteAndFormat (wdFormatSurroundingFormattingWithEmphasis)
End Sub

Last edited by Charles Kenyon; 04-21-2015 at 08:38 PM. Reason: add second macro
Reply With Quote
  #5  
Old 04-21-2015, 11:30 PM
Nicobisgaard Nicobisgaard is offline Custom ribbon button or shortcut for a specific function Windows 7 64bit Custom ribbon button or shortcut for a specific function Office 2010 64bit
Novice
Custom ribbon button or shortcut for a specific function
 
Join Date: Apr 2015
Posts: 8
Nicobisgaard is on a distinguished road
Default

What i was mainly after was a one-click button for:

2) Paste special -> paste link: -> Unformatted text -> Ok.

All the three macros seems to copy the content from excel into word but the "Link" is not copied with the content, into MS word.
When i manually press Paste special -> paste link: -> Unformatted text, i get the number from the excel sheet copied into Word and afterwards when i right click the it, i get the "Update Link" and "linked worksheet object" options indicating that the link from excel is there.
When i use either of the macros (or any other macros i have found) they only paste the value of the cell i copied and not the link.
Reply With Quote
  #6  
Old 04-22-2015, 04:36 AM
Charles Kenyon Charles Kenyon is offline Custom ribbon button or shortcut for a specific function Windows 8 Custom ribbon button or shortcut for a specific function Office 2013
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,125
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

Code:
Sub PasteAsLink()
'
' PasteAsLink Macro
'
'
    Selection.PasteExcelTable True, False, False
End Sub
Reply With Quote
  #7  
Old 04-22-2015, 04:39 AM
Charles Kenyon Charles Kenyon is offline Custom ribbon button or shortcut for a specific function Windows 8 Custom ribbon button or shortcut for a specific function Office 2013
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,125
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

What it took for each of these was to record a simple macro that did what I thought you wanted.

The macro should be stored in a template, probably a different template than normal.dotm. The QAT button should be stored in the same template as the one holding the macro.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Pass Arguments to Function Through Ribbon inagalaxyfarfarawry Word VBA 11 03-25-2022 09:28 PM
Custom ribbon button or shortcut for a specific function Shortcut Key - Ribbon Alt+H RajaGa Word 3 04-17-2015 10:11 AM
Is it possible to add a custom macro button to the FILE tab of the ribbon in excel sbapabck Excel 2 04-11-2014 07:36 AM
How to make a SPECIFIC FONT shortcut button? E922 Word 4 03-18-2014 03:11 PM
Ribbon button - showLabel attribute ignored yiannis.spyridakis Excel Programming 2 06-12-2012 11:21 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:11 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft