Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #7  
Old 06-28-2020, 05:40 AM
ydmq ydmq is offline How to add an event on a shape in document? Windows 10 How to add an event on a shape in document? Office 2013
Banned
How to add an event on a shape in document?
 
Join Date: Jun 2020
Posts: 6
ydmq is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
Your attachment suggests you should be using a Word table rather than pictures. See, for example: https://www.msofficeforums.com/word-...html#post47254
In any event, you can also put the shapes into a table so they're positioned as per your layout.
Thank you for your reply.
I try your suggest.
I try to use table instead of shape.
But I am really not good at VBA,it still can't work.
I have a Class Module (named "ClassCell")
Code:
Public WithEvents objCell As Word.Application
Private Sub objCell_Click()
  MsgBox "Hello"
End Sub

I have a sub in My standard Module:
Code:
Global theCell() As New ClassCell
Global tableNew As Table

Sub toTest()
  Set tableNew = ThisDocument.Tables.Add(Selection.Range, 5, 4)
  Set theCell(1).objCell = ThisDocument.Tables(1).Cell(2, 1)
End Sub

I ran the sub "toTest",then some message appeared:
『 Type mismatch (Error 13) 』


Do you have any suggestion?
Thank you!
Reply With Quote
 

Tags
shape



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to add an event on a shape in document? Unable to get cursor past inserted shape in Word document slknova Word 6 11-09-2021 09:02 AM
I don't understand event handling for the DoubleClick event Larry_1 Excel Programming 5 12-28-2017 08:23 AM
How to change size / shape of a shape in a stencil tomgoodell Visio 1 06-30-2016 04:40 AM
Shape hyperlink doesn't work with protected form document Cosmo Word 0 12-10-2012 01:42 PM
Connect Outlook "Event" to Office Document Yick Office 1 09-23-2011 04:57 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:21 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft