Log in

View Full Version : Help finding a word 2007 command for VB



bigtalljv
08-29-2010, 12:44 PM
Hi,

I am writing a macro to enable and disable protection and to enable the inking feature. Protection allows the check boxes to be used and the they want to be able to shut it off to sign the form with the inking feature. so far I have this and it works great,


Private Sub ClicktoSign_Click()
' ******************************************
' ProtectForm Macro.
' Toggles protection for the active document
' when the Protect Form button on the forms
' toolbar is clicked.
' ******************************************
If ActiveDocument.ProtectionType = wdNoProtection Then
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, _
NoReset:=True
Else
ActiveDocument.Unprotect Password:=""
Application.Run "InsertInkAnnotations"
End If

End Sub

What I can't find is the opposite of Application.Run "InsertInkAnnotations"

There is a command listed in the command list in the macros "DrawExitInkMode" but I can't seem to do anyting with it. all the button are grayed out.

Anybody know what I need to do?

Thanks,
Jason

fumei
08-30-2010, 01:56 PM
I do not use 2007, so I am a bit out my league here. I do not know what the inking feature does.

However, what do you mean by "opposite" to Application.Run "InsertInkAnnotations"?

If this is a procedure (as it appears to be), it executes until it terminates. Are you trying to terminate it before it is finished?

bigtalljv
08-30-2010, 02:07 PM
Inking is a function available for tablet computers, it allows you to write with the stylus on the document.

I am looking to be able to turn that function on and off via a macro. I found the on command but I can't find the off command.

when inking is on the stylus writes on the document, when inking is off the stylus works as a mouse.

I am confused as to why there appears to be a command listed in Macros that I can't use in VB.

Thanks,
Jason

fumei
08-30-2010, 02:20 PM
"I am confused as to why there appears to be a command listed in Macros that I can't use in VB."

Answer: because Microsoft in its infinite we-know-better mode has internal procedures that are NOT exposed to VBA. There are a few. Always have been.

Please post the actual code for "InsertInkAnnotations".

It may in fact be a toggle. In which case, you may be able to use Not.

bigtalljv
09-02-2010, 10:59 AM
Application.Run "InsertInkAnnotations"

is all I have to turn it on. There is no option to edit or anything else for that command, Run or Step Into, no detail.

How does one use the .Not command?

Jason

fumei
09-02-2010, 01:01 PM
Application.Run "InsertInkAnnotations"

means:

Execute the Sub InsertInkAnnotations.

As it is a Sub, it MUST have a structure like:

Sub InsertInkAnnotations
' instructions
End Sub

Nota bene: yes, it could be a Function rather than a Sub.

The question though is whether that Sub is exposed to VBA. Try finding it using the Object Browser and see what it looks like.

bigtalljv
09-03-2010, 09:43 AM
The only reference from MS I found to it is on a list of "Fixed Commands". That sounds a lot like I can't do much with it.

I can't link to it yet.

Jason

bigtalljv
09-03-2010, 09:54 AM
cheating

bigtalljv
09-03-2010, 09:55 AM
http://msdn.microsoft.com/en-us/library/ff529789%28office.12%29.aspx

fumei
09-03-2010, 10:51 AM
That is also a XML reference, not a VBA reference.