Solved

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

Posted on 2011-03-12
16
1,266 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
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 61

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
 

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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

Healthcare providers, insurance companies and other covered entities trust eFax Corporate to transmit their most sensitive documents. eFax Corporate can help your organization implement a HIPAA compliant cloud faxing solution.
Many companies are looking to get out of the datacenter business and to services like Microsoft Azure to provide Infrastructure as a Service (IaaS) solutions for legacy client server workloads, rather than continuing to make capital investments in h…
This video walks the viewer through the process of creating Hyperlinks for the web and other documents. Select the "Insert" tab: Click "Hyperlink":  Type "http://" followed by a web address to reference a website or navigate to a document to ref…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …

707 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now