我在Word中添加一个控件Label 
怎么样在VB中找到这个控件并且为它的Caption 设置值

解决方案 »

  1.   

    工具---宏--VB编辑器....,里面基本上与vb环境类似.....
      

  2.   

    恩~~很感谢你
    不过我问的是这个控件已经在Word文档里面添加了
    我要在VB编辑器中找到这个控件
    怎么做?
    完了马上给分
      

  3.   

    在VBE的工程资源管理器,第二个按钮--查看对象,可以查看你在Word文档中的按钮....
      

  4.   

    比如说我在Word文档里面添加一个Label
    然后在VB窗体中要调用这个Word文档的Label
    怎么做?????
      

  5.   


     Selection.InlineShapes(1).Fill.Visible = msoFalse
        Selection.InlineShapes(1).Fill.Solid
        Selection.InlineShapes(1).Fill.Transparency = 0#
        Selection.InlineShapes(1).Line.Weight = 0.75
        Selection.InlineShapes(1).Line.Transparency = 0#
        Selection.InlineShapes(1).Line.Visible = msoFalse
        Selection.InlineShapes(1).LockAspectRatio = msoTrue
        Selection.InlineShapes(1).Height = 24.1
        Selection.InlineShapes(1).Width = 72#
        Selection.InlineShapes(1).PictureFormat.Brightness = 0.5
        Selection.InlineShapes(1).PictureFormat.Contrast = 0.5
        Selection.InlineShapes(1).PictureFormat.ColorType = msoPictureAutomatic
        Selection.InlineShapes(1).PictureFormat.CropLeft = 14.17
        Selection.InlineShapes(1).PictureFormat.CropRight = 0#
        Selection.InlineShapes(1).PictureFormat.CropTop = 0#
        Selection.InlineShapes(1).PictureFormat.CropBottom = 0#
      

  6.   

    呵呵,好像有点太容易了点吧哈哈哈 ,,很容易呀。。你难道从来没有试过吗??
    Sub aa()
        ThisDocument.Label1.Caption = "AAAAAAA"
    End Sub
      

  7.   

    哦,你是在VB中用呀,那就是要使用VBA了,你要引用word对象 然后定义 document 对象然后就可以用了。  直接就成了。
      

  8.   

    不过,你还可以判断是一下嘛。 到底是不是存在Label 对象。