borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Running a macro at startup in PowerPoint)Next Topic (Using Variables with VB & Word) New Topic New Poll Post Reply
AndreaVB Forum : VBA (Access, Excel, Word, ...) : vba to vb possibly?
Poster Message
drshaw
Level: Guest


icon vba to vb possibly?

HI, I am in need of a little advise to set me off in the right direction.

I am a VBA Developer on MSWord, I have developed some code which I want protecting and have password protected it, it has come to my notice that there is a backdoor facility into VBA projects to allow instant access, so I am looing toward VB to see if I can move the development over and have a bit more security.

Not knowing what all the different types of projects are is making a direction difficult, I was thinking about making a ActiveX DLL file and connecting it to MSWord through the VB IDE, before I spend hours researching this, can anyone tell me if this is the correct way to go or should a different project type be selected, the project has forms, modules and a class module in it that I need to duplicate, I also need to generate a toolbar in Word that will run the code.

Any help would be greatly appreciated
Thanks
David

    

17-06-2003 at 01:27 PM
| Quote Reply
~Bean~
Level: VB Guru


Registered: 07-04-2003
Posts: 488
icon Re: vba to vb possibly?

I am not sure of the "backdoor" but I do know that all Office files, including VBA modules, have wimpy security, in other words, easily hacked. HOWEVER, someone must first be inclined to do so... IMO you should first decide whether it is worth your trouble to RE-Write your entire project...? I am also wondering if you have experience using VB? Also, what is the purpose of the Word Doc? Is it a report? Is it connected to any other data source?


As I see it you have several options...including:

- Leave it in Word and trust Word's security to be sufficient for most users.

- Re-write the entire project in VB and forget Word. (start a new project and choose "Standard EXE" as the project type.)

- Re-write your functions as DLLs, leaving your forms and some code in Word. ("DLL" as your project type)

- Try something out of the box...i.e., remove all the code from your Wrod doc. Then, when the doc starts up, load your code from an encrypted (text) file into the Word VBA modules.

Without knowing more about the nature of your app, I recommend the first option...

____________________________
Eggheads unite! You have nothing to lose but your yolks.

17-06-2003 at 05:45 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
drshaw
Level: Guest

icon Re: vba to vb possibly?

Thanks Bean, I have done a bit of reasearch and found the joy of Addins and am currently looking toward that, the project is a commercial venture adding functionality to Word so the whole security thing is a bit of an issue, The bits I have done in Addins is very exiting (What kind of a geek do I sound like) like VB and can see more work heading that way, opens up a whole new world and new challenges, talking of that I have a little addin that adds a toolbar into Word,works so far, I cannot get it to do anything.
I have highlighted the line that is erroring but I don't know why. I am using VB6

Private WithEvents myEcontrol As CommandBarEvents

Private Sub AddinInstance_OnConnection(ByVal Application As Object, ByVal ConnectMode As AddInDesignerObjects.ext_ConnectMode, ByVal AddInInst As Object, custom() As Variant)
    
    Dim mybar As CommandBar
    Dim mycontrol As CommandBarControl
    
    Set mybar = Application.CommandBars.Add("Test bar")
    
    Set mycontrol = mybar.Controls.Add(msoControlButton)
    With mycontrol
        .FaceId = 20
        .Tag = "TestControl"
        .OnAction = "!<StartForm>"
    End With
    
    Set myEcontrol = Application.Events.CommandBarEvents(mycontrol)
    
    mybar.Visible = True

End Sub

Thanks
David

18-06-2003 at 03:08 PM
| Quote Reply
~Bean~
Level: VB Guru


Registered: 07-04-2003
Posts: 488
icon Re: vba to vb possibly?

That SET statement doesn't seem to serve any purpose in that Sub...do you need it? Besides that, "WithEvents" is only valid in a class module...so that could be why you're getting an error...(what is the error anyways?)

btw, how is the addins security any different than a regular Word docs? As fas as I know they are the same...(?)

____________________________
Eggheads unite! You have nothing to lose but your yolks.

18-06-2003 at 04:56 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
drshaw
Level: Guest

icon Re: vba to vb possibly?

Thanks Bean, I am developing and Activex dll that hooks into Word. I am making good headway into understanding this but has run into a problem.
There is a Dim stament used to catch the click event for the commandbarbutton in Office

Dim WithEvents MyButton As Office.CommandBarButton

I get the following Compile error:

Object does not source automation events

Do you have any idea what this means

20-06-2003 at 02:40 PM
| Quote Reply
~Bean~
Level: VB Guru


Registered: 07-04-2003
Posts: 488
icon Re: vba to vb possibly?

quote:
Object does not source automation events


    

Isn't there an "OnAction" property for commandbar buttons?

____________________________
Eggheads unite! You have nothing to lose but your yolks.
20-06-2003 at 03:07 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
AndreaVB Forum : VBA (Access, Excel, Word, ...) : vba to vb possibly?
Previous Topic (Running a macro at startup in PowerPoint)Next Topic (Using Variables with VB & Word) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder