Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
Hi,
when eidt a word in document, is there any way to konwn the changed word inside a bookmark or not ? Thanks, swje 2007/8/20 |
#2
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
Explain what exactly you are trying to do. Your question is impossible to
answer as it stands. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org swje wrote: Hi, when eidt a word in document, is there any way to konwn the changed word inside a bookmark or not ? Thanks, swje 2007/8/20 |
#3
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
Hi swje,
I don't know if this is what you want but you can turn on the display of bookmarks. Up to Word 2003, go to Tools Options View Show, and tick Bookmarks. In Word 2007, go to Office Button Word Options Advanced Show document content, and tick "Show bookmarks". Bookmarks which don't span a range show up as a grey "I" and bookmarks which do span a range show up as grey square brackets. Regards. Ed "swje" wrote: Hi, when eidt a word in document, is there any way to konwn the changed word inside a bookmark or not ? Thanks, swje 2007/8/20 |
#4
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
Hi Ed,
Thanks for your post. My question is I have made some bookmark in a document, when eidt the document I want code to known where the changed text in a bookmark or not? Thanks, swje "Ed" wrote: Hi swje, I don't know if this is what you want but you can turn on the display of bookmarks. Up to Word 2003, go to Tools Options View Show, and tick Bookmarks. In Word 2007, go to Office Button Word Options Advanced Show document content, and tick "Show bookmarks". Bookmarks which don't span a range show up as a grey "I" and bookmarks which do span a range show up as grey square brackets. Regards. Ed "swje" wrote: Hi, when eidt a word in document, is there any way to konwn the changed word inside a bookmark or not ? Thanks, swje 2007/8/20 |
#5
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
Hi Mayor,
My question is I have made some bookmark in a document, when eidt the document I want code to known where the changed text in a bookmark or not? Thanks, swje "Graham Mayor" wrote: Explain what exactly you are trying to do. Your question is impossible to answer as it stands. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org swje wrote: Hi, when eidt a word in document, is there any way to konwn the changed word inside a bookmark or not ? Thanks, swje 2007/8/20 |
#6
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
Hi swje,
If you can tell us why you want to know that and what you want to do with the imformation someone may be able to suggest something suitable. In the meantime, is something (very basic) like this of any use ... A macro which you run before editing the document which saves bookmark names and bookmarked text into a collection, and a macro which you run after the edit which compares bookmarked text in the document with the corresponding text that was saved by the first macro. E.g. In a module's Declarations section you could have something like this: Dim BMColl as collection and then two sub-procedures like this: Dim BMColl As Collection Sub Before() Dim bm As Bookmark Set BMColl = New Collection For Each bm In ActiveDocument.Bookmarks BMColl.Add bm.Range.Text, bm.Name Next End Sub Sub After() Dim bm As Bookmark For Each bm In ActiveDocument.Bookmarks If bm.Range.Text BMColl.Item(bm.Name) Then MsgBox bm.Name & " has changed" End If Next Set BMColl = Nothing End Sub Regards. Ed "swje" wrote: Hi Ed, Thanks for your post. My question is I have made some bookmark in a document, when eidt the document I want code to known where the changed text in a bookmark or not? Thanks, swje "Ed" wrote: Hi swje, I don't know if this is what you want but you can turn on the display of bookmarks. Up to Word 2003, go to Tools Options View Show, and tick Bookmarks. In Word 2007, go to Office Button Word Options Advanced Show document content, and tick "Show bookmarks". Bookmarks which don't span a range show up as a grey "I" and bookmarks which do span a range show up as grey square brackets. Regards. Ed "swje" wrote: Hi, when eidt a word in document, is there any way to konwn the changed word inside a bookmark or not ? Thanks, swje 2007/8/20 |
#7
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
Ed,
Thanks for your post. Your way can work the problem out. But if there too many bookmarks defined, the efficiency will be not so good, I want to check it in WindowSelectionChange event, it can get the select range changed text, but can't get the original range text before change, if there will be a WindowSelectionClick event and so on, everything will be OK. Thanks, swje "Ed" wrote: Hi swje, If you can tell us why you want to know that and what you want to do with the imformation someone may be able to suggest something suitable. In the meantime, is something (very basic) like this of any use ... A macro which you run before editing the document which saves bookmark names and bookmarked text into a collection, and a macro which you run after the edit which compares bookmarked text in the document with the corresponding text that was saved by the first macro. E.g. In a module's Declarations section you could have something like this: Dim BMColl as collection and then two sub-procedures like this: Dim BMColl As Collection Sub Before() Dim bm As Bookmark Set BMColl = New Collection For Each bm In ActiveDocument.Bookmarks BMColl.Add bm.Range.Text, bm.Name Next End Sub Sub After() Dim bm As Bookmark For Each bm In ActiveDocument.Bookmarks If bm.Range.Text BMColl.Item(bm.Name) Then MsgBox bm.Name & " has changed" End If Next Set BMColl = Nothing End Sub Regards. Ed "swje" wrote: Hi Ed, Thanks for your post. My question is I have made some bookmark in a document, when eidt the document I want code to known where the changed text in a bookmark or not? Thanks, swje "Ed" wrote: Hi swje, I don't know if this is what you want but you can turn on the display of bookmarks. Up to Word 2003, go to Tools Options View Show, and tick Bookmarks. In Word 2007, go to Office Button Word Options Advanced Show document content, and tick "Show bookmarks". Bookmarks which don't span a range show up as a grey "I" and bookmarks which do span a range show up as grey square brackets. Regards. Ed "swje" wrote: Hi, when eidt a word in document, is there any way to konwn the changed word inside a bookmark or not ? Thanks, swje 2007/8/20 |
#8
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
Hi again,
What about something along these lines ... In the class modue (MyObject) ... ----------------------------------------------------------------- Public WithEvents MyApp As Word.Application Private Sub MyApp_WindowSelectionChange(ByVal Sel As Selection) Static BMName As String Static BMText As String Dim bm As Bookmark Dim NewBMText as String If BMName "" Then NewBMText = ActiveDocument.Bookmarks(BMName).Range.Text If BMText NewBMText Then MsgBox BMName & " has changed" End If BMName = "" End If For Each bm In ActiveDocument.Bookmarks If Selection.InRange(bm.Range) Then BMName = bm.Name BMText = bm.Range.Text End If Next ----------------------------------------------------------------- And in a code module ... ----------------------------------------------------------------- Dim MyWordObject As New MyObject Sub Test() Set MyWordObject.MyApp = Word.Application End Sub ----------------------------------------------------------------- It's not without its limitations as it stands - for example, if bookmarked text is changed but the selection isn't changed afterwards, or if the insertion point is in a bookmark range when the document opens. Regards. Ed "swje" wrote: Ed, Thanks for your post. Your way can work the problem out. But if there too many bookmarks defined, the efficiency will be not so good, I want to check it in WindowSelectionChange event, it can get the select range changed text, but can't get the original range text before change, if there will be a WindowSelectionClick event and so on, everything will be OK. Thanks, swje "Ed" wrote: Hi swje, If you can tell us why you want to know that and what you want to do with the imformation someone may be able to suggest something suitable. In the meantime, is something (very basic) like this of any use ... A macro which you run before editing the document which saves bookmark names and bookmarked text into a collection, and a macro which you run after the edit which compares bookmarked text in the document with the corresponding text that was saved by the first macro. E.g. In a module's Declarations section you could have something like this: Dim BMColl as collection and then two sub-procedures like this: Dim BMColl As Collection Sub Before() Dim bm As Bookmark Set BMColl = New Collection For Each bm In ActiveDocument.Bookmarks BMColl.Add bm.Range.Text, bm.Name Next End Sub Sub After() Dim bm As Bookmark For Each bm In ActiveDocument.Bookmarks If bm.Range.Text BMColl.Item(bm.Name) Then MsgBox bm.Name & " has changed" End If Next Set BMColl = Nothing End Sub Regards. Ed "swje" wrote: Hi Ed, Thanks for your post. My question is I have made some bookmark in a document, when eidt the document I want code to known where the changed text in a bookmark or not? Thanks, swje "Ed" wrote: Hi swje, I don't know if this is what you want but you can turn on the display of bookmarks. Up to Word 2003, go to Tools Options View Show, and tick Bookmarks. In Word 2007, go to Office Button Word Options Advanced Show document content, and tick "Show bookmarks". Bookmarks which don't span a range show up as a grey "I" and bookmarks which do span a range show up as grey square brackets. Regards. Ed "swje" wrote: Hi, when eidt a word in document, is there any way to konwn the changed word inside a bookmark or not ? Thanks, swje 2007/8/20 |
#9
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
Hi Ed,
Thanks for your help. My program can works fine now. If it's not too much trouble,I want to ask you another question: In word, as we said above, we can named a bookmark to save some meaningful words, and check it's change. Is it has any object in PowerPoint can do the same things: named a ojbect to save text, and can check it's change. Thanks, swje "Ed" wrote: Hi again, What about something along these lines ... In the class modue (MyObject) ... ----------------------------------------------------------------- Public WithEvents MyApp As Word.Application Private Sub MyApp_WindowSelectionChange(ByVal Sel As Selection) Static BMName As String Static BMText As String Dim bm As Bookmark Dim NewBMText as String If BMName "" Then NewBMText = ActiveDocument.Bookmarks(BMName).Range.Text If BMText NewBMText Then MsgBox BMName & " has changed" End If BMName = "" End If For Each bm In ActiveDocument.Bookmarks If Selection.InRange(bm.Range) Then BMName = bm.Name BMText = bm.Range.Text End If Next ----------------------------------------------------------------- And in a code module ... ----------------------------------------------------------------- Dim MyWordObject As New MyObject Sub Test() Set MyWordObject.MyApp = Word.Application End Sub ----------------------------------------------------------------- It's not without its limitations as it stands - for example, if bookmarked text is changed but the selection isn't changed afterwards, or if the insertion point is in a bookmark range when the document opens. Regards. Ed "swje" wrote: Ed, Thanks for your post. Your way can work the problem out. But if there too many bookmarks defined, the efficiency will be not so good, I want to check it in WindowSelectionChange event, it can get the select range changed text, but can't get the original range text before change, if there will be a WindowSelectionClick event and so on, everything will be OK. Thanks, swje "Ed" wrote: Hi swje, If you can tell us why you want to know that and what you want to do with the imformation someone may be able to suggest something suitable. In the meantime, is something (very basic) like this of any use ... A macro which you run before editing the document which saves bookmark names and bookmarked text into a collection, and a macro which you run after the edit which compares bookmarked text in the document with the corresponding text that was saved by the first macro. E.g. In a module's Declarations section you could have something like this: Dim BMColl as collection and then two sub-procedures like this: Dim BMColl As Collection Sub Before() Dim bm As Bookmark Set BMColl = New Collection For Each bm In ActiveDocument.Bookmarks BMColl.Add bm.Range.Text, bm.Name Next End Sub Sub After() Dim bm As Bookmark For Each bm In ActiveDocument.Bookmarks If bm.Range.Text BMColl.Item(bm.Name) Then MsgBox bm.Name & " has changed" End If Next Set BMColl = Nothing End Sub Regards. Ed "swje" wrote: Hi Ed, Thanks for your post. My question is I have made some bookmark in a document, when eidt the document I want code to known where the changed text in a bookmark or not? Thanks, swje "Ed" wrote: Hi swje, I don't know if this is what you want but you can turn on the display of bookmarks. Up to Word 2003, go to Tools Options View Show, and tick Bookmarks. In Word 2007, go to Office Button Word Options Advanced Show document content, and tick "Show bookmarks". Bookmarks which don't span a range show up as a grey "I" and bookmarks which do span a range show up as grey square brackets. Regards. Ed "swje" wrote: Hi, when eidt a word in document, is there any way to konwn the changed word inside a bookmark or not ? Thanks, swje 2007/8/20 |
#10
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
Hi swje,
You're welcome. I suspect that I won't be able to help with the PowerPoint question. I've never written any code for PPT. If no-one else supplies an answer, check this thread in a couple of days and I'll let you know whether I've found anything. In the meantime it might be worth posting your query as a new question in the PowerPoint NG. Regards. Ed "swje" wrote: Hi Ed, Thanks for your help. My program can works fine now. If it's not too much trouble,I want to ask you another question: In word, as we said above, we can named a bookmark to save some meaningful words, and check it's change. Is it has any object in PowerPoint can do the same things: named a ojbect to save text, and can check it's change. Thanks, swje "Ed" wrote: Hi again, What about something along these lines ... In the class modue (MyObject) ... ----------------------------------------------------------------- Public WithEvents MyApp As Word.Application Private Sub MyApp_WindowSelectionChange(ByVal Sel As Selection) Static BMName As String Static BMText As String Dim bm As Bookmark Dim NewBMText as String If BMName "" Then NewBMText = ActiveDocument.Bookmarks(BMName).Range.Text If BMText NewBMText Then MsgBox BMName & " has changed" End If BMName = "" End If For Each bm In ActiveDocument.Bookmarks If Selection.InRange(bm.Range) Then BMName = bm.Name BMText = bm.Range.Text End If Next ----------------------------------------------------------------- And in a code module ... ----------------------------------------------------------------- Dim MyWordObject As New MyObject Sub Test() Set MyWordObject.MyApp = Word.Application End Sub ----------------------------------------------------------------- It's not without its limitations as it stands - for example, if bookmarked text is changed but the selection isn't changed afterwards, or if the insertion point is in a bookmark range when the document opens. Regards. Ed "swje" wrote: Ed, Thanks for your post. Your way can work the problem out. But if there too many bookmarks defined, the efficiency will be not so good, I want to check it in WindowSelectionChange event, it can get the select range changed text, but can't get the original range text before change, if there will be a WindowSelectionClick event and so on, everything will be OK. Thanks, swje "Ed" wrote: Hi swje, If you can tell us why you want to know that and what you want to do with the imformation someone may be able to suggest something suitable. In the meantime, is something (very basic) like this of any use ... A macro which you run before editing the document which saves bookmark names and bookmarked text into a collection, and a macro which you run after the edit which compares bookmarked text in the document with the corresponding text that was saved by the first macro. E.g. In a module's Declarations section you could have something like this: Dim BMColl as collection and then two sub-procedures like this: Dim BMColl As Collection Sub Before() Dim bm As Bookmark Set BMColl = New Collection For Each bm In ActiveDocument.Bookmarks BMColl.Add bm.Range.Text, bm.Name Next End Sub Sub After() Dim bm As Bookmark For Each bm In ActiveDocument.Bookmarks If bm.Range.Text BMColl.Item(bm.Name) Then MsgBox bm.Name & " has changed" End If Next Set BMColl = Nothing End Sub Regards. Ed "swje" wrote: Hi Ed, Thanks for your post. My question is I have made some bookmark in a document, when eidt the document I want code to known where the changed text in a bookmark or not? Thanks, swje "Ed" wrote: Hi swje, I don't know if this is what you want but you can turn on the display of bookmarks. Up to Word 2003, go to Tools Options View Show, and tick Bookmarks. In Word 2007, go to Office Button Word Options Advanced Show document content, and tick "Show bookmarks". Bookmarks which don't span a range show up as a grey "I" and bookmarks which do span a range show up as grey square brackets. Regards. Ed "swje" wrote: Hi, when eidt a word in document, is there any way to konwn the changed word inside a bookmark or not ? Thanks, swje 2007/8/20 |
#11
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
Hi swje,
I've been playing around with PPT code and made a little bit of progress but I think it would take me quite a while before I'd be able to give any decent coding advice. So, I'd suggest that you ask the experts in the PPT NG, and it might be helpful if you could tell them a few things: The version of PowerPoint you're using. What it is you want to do. (Including whether what you want is for design mode or presentation mode.) Why you want to do it - i.e. the purpose of the exercise. Hope they can help. Regards. Ed "swje" wrote: Hi Ed, Thanks for your help. My program can works fine now. If it's not too much trouble,I want to ask you another question: In word, as we said above, we can named a bookmark to save some meaningful words, and check it's change. Is it has any object in PowerPoint can do the same things: named a ojbect to save text, and can check it's change. Thanks, swje "Ed" wrote: Hi again, What about something along these lines ... In the class modue (MyObject) ... ----------------------------------------------------------------- Public WithEvents MyApp As Word.Application Private Sub MyApp_WindowSelectionChange(ByVal Sel As Selection) Static BMName As String Static BMText As String Dim bm As Bookmark Dim NewBMText as String If BMName "" Then NewBMText = ActiveDocument.Bookmarks(BMName).Range.Text If BMText NewBMText Then MsgBox BMName & " has changed" End If BMName = "" End If For Each bm In ActiveDocument.Bookmarks If Selection.InRange(bm.Range) Then BMName = bm.Name BMText = bm.Range.Text End If Next ----------------------------------------------------------------- And in a code module ... ----------------------------------------------------------------- Dim MyWordObject As New MyObject Sub Test() Set MyWordObject.MyApp = Word.Application End Sub ----------------------------------------------------------------- It's not without its limitations as it stands - for example, if bookmarked text is changed but the selection isn't changed afterwards, or if the insertion point is in a bookmark range when the document opens. Regards. Ed "swje" wrote: Ed, Thanks for your post. Your way can work the problem out. But if there too many bookmarks defined, the efficiency will be not so good, I want to check it in WindowSelectionChange event, it can get the select range changed text, but can't get the original range text before change, if there will be a WindowSelectionClick event and so on, everything will be OK. Thanks, swje "Ed" wrote: Hi swje, If you can tell us why you want to know that and what you want to do with the imformation someone may be able to suggest something suitable. In the meantime, is something (very basic) like this of any use ... A macro which you run before editing the document which saves bookmark names and bookmarked text into a collection, and a macro which you run after the edit which compares bookmarked text in the document with the corresponding text that was saved by the first macro. E.g. In a module's Declarations section you could have something like this: Dim BMColl as collection and then two sub-procedures like this: Dim BMColl As Collection Sub Before() Dim bm As Bookmark Set BMColl = New Collection For Each bm In ActiveDocument.Bookmarks BMColl.Add bm.Range.Text, bm.Name Next End Sub Sub After() Dim bm As Bookmark For Each bm In ActiveDocument.Bookmarks If bm.Range.Text BMColl.Item(bm.Name) Then MsgBox bm.Name & " has changed" End If Next Set BMColl = Nothing End Sub Regards. Ed "swje" wrote: Hi Ed, Thanks for your post. My question is I have made some bookmark in a document, when eidt the document I want code to known where the changed text in a bookmark or not? Thanks, swje "Ed" wrote: Hi swje, I don't know if this is what you want but you can turn on the display of bookmarks. Up to Word 2003, go to Tools Options View Show, and tick Bookmarks. In Word 2007, go to Office Button Word Options Advanced Show document content, and tick "Show bookmarks". Bookmarks which don't span a range show up as a grey "I" and bookmarks which do span a range show up as grey square brackets. Regards. Ed "swje" wrote: Hi, when eidt a word in document, is there any way to konwn the changed word inside a bookmark or not ? Thanks, swje 2007/8/20 |
Reply |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Bookmark Text color change | Microsoft Word Help | |||
Editing Bookmark Text | Microsoft Word Help | |||
The Insert Bookmark box shouldnt vanish after adding a bookmark. | Microsoft Word Help | |||
Add Bookmark text to a header or footer | New Users | |||
Copy text in Word = OLE_LINKx Bookmark | Page Layout |