How to write a macro using VB.NET
Hello all
I have a word file and I want to restrict a copy paste in it, so I need to write a macro for that word file, I know how to write it but i want to do it programmatically using vb.net
How can i do that ? Macro should run for that specific file
Here is my macro
Code:
Sub EditCopy()
MsgBox “Forbidden”, vbExclamation
End Sub
Sub EditPaste()
MsgBox “Forbidden”, vbExclamation
End Sub
Please help
Thanks in advance
Re: How to write a macro using VB.NET
Re: How to write a macro using VB.NET
Is programming even really needed to do this? Couldnt you just Protect the document?
Re: How to write a macro using VB.NET
Quote:
Originally Posted by
RobDog888
Is programming even really needed to do this? Couldnt you just Protect the document?
Thanks for reply RobDog
What I exactly want is, avoid copy paste content and printing from my word document, I have tried with word protection with 'readonly' locking but, still I can able to copy and paste my word file content.
So I go for word macro.
How can I write macro using VB.NET for a given word file ?
Basically I need to develop program in vb.net where user can browse his word file and I can disable its copy paste facility by using macro.
Re: How to write a macro using VB.NET
IMHO, You cannot do it via VB.Net unless you write a VSTO Add-in for the word document.
By any chance did you mean VBA and not VB.Net?
Re: How to write a macro using VB.NET
You cannot truely protect it with code or word protection as anyone that can view it can take screen shots and print that etc. You could put a watermark on it to make your ownership known