0

My company needs to develop a specific add-in for Word 2007 and I am in charge of studying if its possible to do so.

After 2 hours reading the MSDN reference, I need some help. I have 2 basic needs :

  • Detect when a user click on a hyperlink (or when a user reach a bookmark). -->> I didn't find any events for that in the reference. IN PROGRESS

  • Return the list of texts which match with a given regular expression. -->> I found that for Word 2010, there is a function Range Range.Find() which can do that but nothing for Word 2007. I just found the bool Find.execute but I don't get the point of this function as its only allow to know that something match but we don't know what matches and where ... SOLVED

Hope you will be able to help me. Anyway, thanks for reading.

Nicolas
  • 743
  • 1
  • 7
  • 15
  • 1
    **Point 1**- see [THIS Solution](http://stackoverflow.com/questions/21163867/restrict-lock-bookmarks-from-editing-in-word/21260907#21260907) which, by using `ContentControls`, shows how to control if user enters bookmark text range. I think you could do the same for hyperlinks. **Point 2**- `Find object` is working for Word 2007 as well, see [THIS MSDN](http://msdn.microsoft.com/en-us/library/bb211938%28v=office.12%29.aspx) – Kazimierz Jawor Feb 28 '14 at 07:11
  • For point 1, I don't think you will be able to process hyperlink clicks or bookmark clicks in arbitrary third party documents without modifying the document in some way first. You may have realised that you can "intercept" many Word Commands by writing a same-name VBA Sub, but unfortunately writing your own "HyperlinkOpen" Sub only intercepts the Open Hyperlink option on the hyperlink context menu. It doesn't intercept when you click/ctrl-click on the link. FOr bookmarks, if you are using .NET/VSTO, VSTO's own bookmarks provide some more events. But not Click, AFAICR. –  Feb 28 '14 at 13:23

0 Answers0