AutoHotkey Community

It is currently May 27th, 2012, 11:42 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: send, ^c and Word 2007
PostPosted: May 10th, 2010, 7:39 pm 
Offline

Joined: May 21st, 2007, 3:44 pm
Posts: 176
Location: USA
I had taken an idea from someone here and written an all inclusive helper for wrapping existing text in quotes/dbl quotes/parens/brackets/sq brackets.

All was so blissful, until the company upgraded to Office 2007. Now, any macro that uses ctl-c to grab highlighted text no longer gets the text. The Deluxe Clipboard from Laslo also shows this problem, so I am sure that it wasn't one of my coding errors.

I have tried all sorts of clipwait settings, but that doesn't help. Word seems to be stealing the ctl-c.

I have tried turning off the Office 2007 clipboard, but it seems to not turn off the feature, it just turns off the display of the clipboard history list.

Has anyone found a workaround for this problem?

Thank you.

_________________
-------------
Scott Mattes
Image
My small, and slowly growing, collection of scripts.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 10th, 2010, 8:09 pm 
Offline

Joined: August 21st, 2006, 7:07 pm
Posts: 2925
Location: The Shell
I concur that WinWord stops send, ^c from working..
Just tried it with Word running and closed.

I will post if I can stop it from happening..

edit:

Ok weird, I restarted Word and then ^c from ahk works.
If I use clipwait, and copy from Word, the clipboard in AHK is empty using:
Code:
clipboard=
send, ^c
clipwait
msgbox % clipboard
Going to keep messing with this..

edit edit:

Looks like Words clipboard creates a clip.htm file in (xp):

C:\DOCUME~1\user\LOCALS~1\Temp\msohtml1\*n(01)

Its created and deleted very fast so its hard to tell whats in there.

Will try to get one and report back..

_________________
Imageparadigm.shift:=(•_•)┌П┐RTFM||^.*∞


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 10th, 2010, 10:49 pm 
Offline
User avatar

Joined: March 19th, 2008, 12:43 am
Posts: 5482
Location: the tunnel(?=light)
Would it be a big burden to convert the existing scripts to use a COM call to get the highlighted text? This should work for grabbing highlighted text in the active instance of Word:

Code:
COM_CoInitialize(), wd :=   COM_GetActiveObject("Word.Application")
COM_Invoke(wd,"Selection.Copy")
MsgBox %   Clipboard
COM_Release(wd),COM_CoUninitialize()
return

_________________
Image
Try Quick Search for Autohotkey or see the tutorial for newbies.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 11th, 2010, 3:20 am 
That would be doable (and thank you for the code example).

I was pleased with having a straight forward, no exceptions type of macro that worked everywhere though.

I think that I'll complain to my corporate IT people and also to MS for hijacking the clipboard, put your code snippet into my code and be done with it.


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], MSN [Bot] and 20 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group