Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old April 26th, 2004, 09:00 AM
Registered User
 
Join Date: Apr 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default adding VBA code to VB

I'm quite new to VB and I am trying to create a program that requires a line of VB code and a line of VBA code to do what it needs to do.

basically, I need to launch microsoft word, then run this VBA code:
Options.DefaultFilePath (wdWorkgroupTemplatesPath) = "\\server\share\workgrouptemplates"

the trouble is, it isn't recognizing the syntax for the vba stuff. I was wondering if I need to preface that code with some kind of switch or introduction that tells vb we're speaking in VBA now.

thanks!!!!

Reply With Quote
  #2 (permalink)  
Old April 27th, 2004, 02:27 AM
Authorized User
 
Join Date: Aug 2003
Location: , , Belgium.
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
Default

In can add a reference to the word object library. (Project/References)

Then you can do the following:

Dim woApp as new Word.Application

set woApp = CreateObject("Word.Application")

If you typ woApp. you should get the available functions.

Greetz

Tom.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding Records with VBA rohit_ghosh Access VBA 7 June 22nd, 2007 05:05 AM
Code works in Excel VBA but not Access VBA fossx Access VBA 2 May 21st, 2007 08:00 AM
Why does Excel VBA code run faster than VB? mambojedi Pro VB 6 3 April 24th, 2006 02:48 PM
convert vba code to vb tommy03 VB How-To 3 February 23rd, 2005 01:13 PM
Adding or updating record using VBA egivler Access VBA 0 August 31st, 2004 11:06 AM



All times are GMT -4. The time now is 11:59 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.