Solved

I would like an md5 sum or something like it for what is in the clipboard

Posted on 2011-03-12
16
1,331 Views
Last Modified: 2012-05-11
I have a serices of error codes that come in 5 cells of a table ( in word) .  

there is NOT someting unique in any cell however all 5 cells together are unique.  

I need to Name a fix script and I was hopng that I could copy all 5 cells, right click and produce a number which would be the name of the fix for the error name that spans these 5 cells.

I can not however show you the table.  It is just 5 cells with stuff in them.
0
Comment
Question by:TIMFOX123
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
16 Comments
 
LVL 6

Expert Comment

by:Melannk24
ID: 35119048
I am not sure if I am understand your question, but this prior Expert Exchange thread may help you out.  I don't know of something that's out there that you can just install and right click, but with VB scripting you are able to write the functionality you want within the world of MS apps.

http://www.experts-exchange.com/Microsoft/Development/MS_Access/Access_Coding-Macros/Q_22805011.html
0
 

Author Comment

by:TIMFOX123
ID: 35119251
Wow, that is not something I reall want to explore.

Ideally I would like to select text, bye <control><C> to copy it.
md5 sum the text
paste the md5sum of the text on the line after the text.

0
 
LVL 63

Expert Comment

by:btan
ID: 35119695
Some links to share
- selecting cell and copy into clipboard @ http://excel.bigresource.com/Track/excel-wqTVZRRF/
- clipboard script @ http://www.everythingaccess.com/tutorials.asp?ID=Copying-data-to-and-from-the-Clipboard-%28Acc-95%2B%29
- another similar to above - see the second page (or post #11) @ http://excel.bigresource.com/Track/excel-Feg4TJyz/ 
- VBscript of md5 @ http://www.lazygame.com/forum/viewthread.php?tid=83

possibly have them as macro in your working document and called it upon selection - passing in the strings for generating hash
but the challenge is that the hash need to store somewhere for verifications, maybe another separate file
0
Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

 

Author Comment

by:TIMFOX123
ID: 35121415
OK, I am going to be jiggy with the vpscript.   I know you have people there that love to do it.

Can someone scratch me up a simple script ( I can understand ) that I can simply REPLACE the contents of the with the md5sum of it.

I would copy to the clipboard.
click on an icon of the script created for me..
Now I can paste the md5 sum of what used to be in the clipboard.

I will be in word however the script can stand alone or not.  

I really need to learn this office scripting.  





0
 

Author Comment

by:TIMFOX123
ID: 35121418
actually the script would work better for me as a stand alone.
It's own icon.

0
 

Author Comment

by:TIMFOX123
ID: 35121420
Also it does not need to be an md5sum,  any hash would do.
0
 

Author Comment

by:TIMFOX123
ID: 35121634
cool thx
0
 
LVL 45

Expert Comment

by:aikimark
ID: 35121666
@TIMFOX123

Is there only one line in the Word table?
Do you really need to use the clipboard?

======
Please create two Word documents with fake data and post it to this thread.  These documents would be the before and after of what you need.

======
As long as the code knows what you need, I suggest using Crypto API in VBA environment to generate the hash value which would then be inserted into the document.
Examples:
http://support.microsoft.com/kb/821762
http://social.msdn.microsoft.com/Forums/en/isvvba/thread/84d49593-2d8e-4e7c-af3a-61882af9557d
http://www.vbforums.com/showthread.php?t=525133

I've used Ken Isaac's libraries in my applications:
http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=73477&lngWId=1
0
 

Author Comment

by:TIMFOX123
ID: 35125949
Cool stuff. however I am not that good with vbscript.  Have not really figured out how to run it on my system.

Found an intresting read

http://www.nilpo.com/2007/08/windows-xp/scripting-the-clipboard-contents-in-wsh/

I just want to take info into the clipboard and replace it with it's md5sum

I create the document and would like to have the option of using it other places.  I would like to have it more freestanding if possable.  

0
 

Author Comment

by:TIMFOX123
ID: 35126619
Here is an example of the 4 cells in text format ( it will produce a unique string using md5sum)

Unowned GID      Red      None      / etc / opt /license      :: 5551212
0
 
LVL 45

Expert Comment

by:aikimark
ID: 35127293
please answer my questions
0
 

Author Comment

by:TIMFOX123
ID: 35127529
Is there only one line in the Word table?  
the line waps around and it is not somethign you can depend on.  it is mutliple cells

Do you really need to use the clipboard?
I would really perfer it.  That way I can us it on the web page that produces it or I can use it in the word doc where I paste the same information.  

the clip board is the the only way I can think of making it truely portable.

Any sugesttions.  ?  I want to be able to do an md5 sum and the real objective it so call a unix shell script that fixes the issue.  I do not want it fully automated because I really need to verify the script needs to be run and if so, then run it.  




0
 
LVL 45

Expert Comment

by:aikimark
ID: 35128637
You can get the clipboard contents in two ways, API call and through the MSforms dataobject.

A decent API article with example code is here:
http://www.everythingaccess.com/tutorials.asp?ID=Copying-data-to-and-from-the-Clipboard-(Acc-95%2B)

Below is a function that will return the text in the clipboard.  This code requires you to add a reference to the Microsoft Forms 2.0 library (Tools | References).  If you don't see it in your list, then click the Browse button and select FM20.DLL

You could also do the hashing of the string as well as repopulate the clipboard via the
objDataObject.SetText  'followed by the new text
objDataObject.PutInClipboard

Open in new window

methods.

Option Explicit

Public Function GetClipboardText() As String
    Dim objDataObject As New MSForms.DataObject
    Dim strCB As String
    objDataObject.GetFromClipboard
    strCB = objDataObject.GetText
    GetClipboardText = strCB
End Function

Open in new window

0
 

Author Comment

by:TIMFOX123
ID: 35129004
aikimark:

this cleary looks like we are in a good direction.  The issue is that I do not know how to impliment this script.  Back in the day I used to write wsh / vbscipt and all I did was put the information in a .vbs file.  

How does this work  ?

Can I do an md5sum on the clipboard ?

Thank you so much for helping me.  Where you are strong, I am not.  

0
 
LVL 45

Accepted Solution

by:
aikimark earned 500 total points
ID: 35129254
This all runs in the Word environment.  Once you have the desired code, you would click a button that would invoke this 'macro' VBA code.

This is not done in a VBScript environment.

Please look at the various hashing links and play with the code.  Once you have the contents of the clipboard in a string variable, you can pass that to a hashing function.
0

Featured Post

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to import an Outlook PST file to Office 365 using a third party product to avoid Microsoft's Azure command line tool, saving you time.
I was prompted to write this article after the recent World-Wide Ransomware outbreak. For years now, System Administrators around the world have used the excuse of "Waiting a Bit" before applying Security Patch Updates. This type of reasoning to me …
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question