看了vba中关于控制word审阅批注来源的用法:If ActiveDocument.Comments.Count >= 1 Then
    With ActiveDocument.Comments(1)
        .Author = "Joe Smith"
        .Initial = "JAS"
    End With
End If    不知道如何转化为delphi代码???
我是这样做的....//用olecontainer打开一个word程序
 olecontainer1.CreateObjectFromFile('c:\word',true);
 //显示
 olecontainer1.DoVerb(-1);
 //取得oleobject
 word:=OleContainer1.OleObject;
 //  可以通过这句来控制对该文档进行修订跟踪
 word.TrackRevisions:=True;  (能达到目的)
  // 但是不能通过下面语句控制该文档的审阅批注来源
 word..Comments(1).Author='a';(报错)
  //尝试以下方法也不成功
OleContainer1.OleObject.Application.ActiveDocument.Comments(1).Author='a';(报错)
 
  请各位帮忙阿,不胜感激!!!

解决方案 »

  1.   

    怎么没人帮忙?见死不救阿.....
    我也考虑过用delphi直接调用word宏
    但是不知道具体如何实现...,有大侠帮忙吗?谢谢
      

  2.   

    我一直使用的是Server组件面板上的自动化控件,这些控件能够实现comments的效果,可参考
    http://expert.csdn.net/Expert/topic/1105/1105886.xml?temp=.5982935
      

  3.   

    谢谢,我马上试试。但是我需要把word嵌入到自己的界面中,所以只能用olecontainer来做。再次感谢关注本贴。搞定后就加分 :)
      

  4.   

    to daniel007 :我看了那篇帖子,上面好像没说怎么实现comments的效果?If ActiveDocument.Comments.Count >= 1 Then
        With ActiveDocument.Comments(1)
            .Author = "Joe Smith"
            .Initial = "JAS"
        End With
    End If
        还是不知道这个comments(1)该怎么对应到delphi中去?
     请继续帮忙,谢谢。
      

  5.   

    If TWordDocument.Comments.Count >= 1 Then
        With TWordDocument.Comments(1)
            .Author = "Joe Smith"
            .Initial = "JAS"
        End With
    End If