• WSmandelbrot

    WSmandelbrot

    @wsmandelbrot

    Viewing 15 replies - 1 through 15 (of 38 total)
    Author
    Replies
    • in reply to: Limitation of Ribbon Control Repurposing (Word 2007) #1134180

      oops. I did not read this article.

      Thank you very much. In previous versoins of Word, we can write macros with the same names as built-in commands to intercept them. It also worked for buttons only. I thought the new Word version should be more powerful.Now it seems to be just a change of interface.

      I do not understand why MS stops at this step. It allows me to override the Bold button, but does not do the same thing for the change of Font Size.

    • in reply to: Why Range.Delete failed? (Word 2003) #1043121

      Thanks Hans. That solves my puzzle.

      Are there any information that clears lists which VBA methods are not available when which dialogs are active?

    • in reply to: Why Range.Delete failed? (Word 2003) #1043088

      I did more tests and got some detailed information.

      When the spelling and grammar check dialog is active, I can only perform Range.Delete in the active document. While I tried to do so in an inactive document, it failed. I tried it in a VBA macro, it pops out a message: ” This method or property is not available because the proofing dialog is active.”

      I cannot see any logic behind this rediculous limitation. I cannot activate a document just because I want to access it. Is there any way to avoid this problem?

      Thanks

    • in reply to: Office API controlling Clipboard (Microsoft Office 2003) #1034060

      Hi, StuartR,

      The approach works perfect when I get things out from a document. However, when I tried to put data back into the document, problems occurs.

      When I tried to put the data into the temporary document with

      Document.HTMLProject.HTMLProjectItems(1).Text = Something

      Data do not appear in the document (neither in the interface or from the API) until I call Document.HTMLProject.RefreshDocument. The RefreshDocument method has a series of sideeffect. First, the refreshing process is slow. Second, I hid the temporary document before, but this function call make it appear. Although I can hide it again, the flashing effect is undesirable. Finally, after this method is called, the Document object becomes unavailable. I have to get this object back, which is troublesome.

      Any suggestion is appreciated.

      Thanks

    • in reply to: Office API controlling Clipboard (Microsoft Office 2003) #1027347

      Thank you very much, StuartR. This solved the problem that has puzzled me for months.

      I save the user input into a file and later replay it to Word to simulate an editing session, so I need the content to be self-contained and can exist independent of Word. With the HTML text and Selection information, I can achieve this purpose now.

    • in reply to: Office API controlling Clipboard (Microsoft Office 2003) #1027332

      Thank you, StuartR.

      This approach is able to provide me the whole document. However, what I want is only a small section of it. For example, the shape the user just created. With a whole document in HTML, I have to integrate a HTML parser to get the correct content. And for a long document, getting the whole document might be slow.

    • in reply to: Office API controlling Clipboard (Microsoft Office 2003) #1027324

      My program moinitors the user’s actions in the Word document, and tries to get the what the user has inserted in the document (e.g. rich formated text, clip arts or shapes). The only way I currently know to get data out of a Word document is to copy it to the clipboard and read it in RTF format. Now copy is done with Word API (e.g. Range.Copy), and clipboard reading is done with Windows API (i.e. the DataObject).

      In this way, I can only use the first clipboard, which overlaps with the Windows clipboard. So I have to backup the clipboard content before copying and restore it afterwards. Since Word has so many clipboards, I feel my current approach a waste.

      After all, my final purpose is to get part of the document (e.g. a Range) out of the document (e.g. a RTF string). If there are other ways to do it, I can avoid using the clipboard.

      Thanks.

    • Thank you very much. It solves the problem.

    • in reply to: Selection position in Reviewing Pane? (Word XP) #910944

      I also noticed that the old comment pane appears when I created the comment with VBA. Although this pane looks slightly different from the comment pane in Word 2000, the Selection object still works. But this pane only appears while a comment is created in this way. In other cases, I always get the new reviewing pane. It seems that MS is interested in producing fancy features rather than making them stable.

    • in reply to: Selection position in Reviewing Pane? (Word XP) #910945

      I also noticed that the old comment pane appears when I created the comment with VBA. Although this pane looks slightly different from the comment pane in Word 2000, the Selection object still works. But this pane only appears while a comment is created in this way. In other cases, I always get the new reviewing pane. It seems that MS is interested in producing fancy features rather than making them stable.

    • in reply to: Setting Event Listeners in Word Add In (Word 2k/XP) #855049

      Unfortunately, this is a template. I cannot use the COM Add In because there are macros overriding Word built-in commands.

    • in reply to: Setting Event Listeners in Word Add In (Word 2k/XP) #855050

      Unfortunately, this is a template. I cannot use the COM Add In because there are macros overriding Word built-in commands.

    • in reply to: Word Overriding Macros in Add-In (Word 2K/XP) #853375

      That makes sense for the problem.
      Thanks

    • in reply to: Word Overriding Macros in Add-In (Word 2K/XP) #853376

      That makes sense for the problem.
      Thanks

    • in reply to: Intercepting Word Commands? (Word 2K/XP) #850953

      Hi, Jefferson. Do you something like this attatchment? In this document, there are some sample macros. SetHook( ) tries to set an event hook for the font color button. However, when I assign that control to a button variable, the VB interpreter says that “type mismatch”. In fact, it is not a “msoControlButton” but a “msoControlSplitDropdown”. Although a variable of msoCommandBarControl type can handl it, but such a variable does not any event.

      Actually, I found 3 approaches to intercept the commands for Word. The first 1 is to set the event listeners for buttons. The second one is to change the onAction attribute. The last one is to create overriding macros with the same command name. None of them is a complete solution, but I am considering whether a combination would meet my requirement.

    Viewing 15 replies - 1 through 15 (of 38 total)