VB/word 2000/template forms

Reply

Join Date: Sep 2006
Posts: 2
Reputation: M. Nicholas is an unknown quantity at this point 
Solved Threads: 0
M. Nicholas M. Nicholas is offline Offline
Newbie Poster

VB/word 2000/template forms

 
0
  #1
Sep 25th, 2006
I need help with VB in a MS Word 2000 macro/form, hope I’m in the right place.

We have created templates (with help from a VB 6 programmer) that have a form to fill in information on the word doc. I need to make a major upgrade (the original programmer is not available).

I need to be able to fill a variable with a chosen file (or files) path. I created a txtBox on the form (for the template), and after some searching on the Internet, found some code to make a button launch a windows explorer window to a specific directory.

What I would like to do now is be able to highlight one or more files in windows explorer and somehow have their paths fill a variable. I found some code that will fill a listbox with a file path if you drag it and drop it. The instructions said to “Set the Form OLEDropMode Property to 1 - manual”. I can’t find such a creature on this template’s VB form. So for now, I’m still looking around.

Any ideas on creating a variable from the path of a highlighted file in Windows Explorer on my VB form built into my word 2000 template??

Thanks…

Mike
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: VB/word 2000/template forms

 
0
  #2
Sep 25th, 2006
The code you found is for VB6, not VBA. The VB Editor INSIDE of office (excel, word, etc) is VBA (Visual Basic For Applications) which is a stripped down version of actual visual basic. It lacks some major functionality required to be a full-fledged programming language. As far as I can tell, the user forms in VBA don't offer the kind of control for dragging and dropping files from explorer. Visual Basic 6 DOES offer this, but that doesn't help you at all with your problem in VBA. It doesn't even seem like it will allow us to create a drivelist or filelist box control with early or late binding in VBA..... The only way I would imagine doing it, would be with a full-fledged VB app, and having that App use the word document as a backend...
Reply With Quote Quick reply to this message  
Join Date: Sep 2006
Posts: 2
Reputation: M. Nicholas is an unknown quantity at this point 
Solved Threads: 0
M. Nicholas M. Nicholas is offline Offline
Newbie Poster

Re: VB/word 2000/template forms

 
0
  #3
Sep 25th, 2006
Okay…that’s not what I had hoped for, but…

Is there another way to get VBA to load a variable that is the path of a selected file? I have these templates already constructed and being used, if there is a way to not start over, that would be preferred.

Thanks

Mike

Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: VB/word 2000/template forms

 
0
  #4
Sep 25th, 2006
If all the templates are (or, if you can make them) stored in the same directory (in the same folder), then you could make VBA gather a list of all the template files in the folder, and display that in a listbox (this would require some redesign, so that you would no longer need/use the explorer in a specific folder). Then, allow the user to select an item in the listbox (a filename) and do whatever you'd like with it....... that's about the closest you can get to it....
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC