Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 28th, 2003, 12:41 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default Word VBA Syntax Needed

Can someone show me the syntax in a Microsoft Word XP VBA procedure that would read data from a linked (ODBC) Microsoft Access MDB file and compose a Novell GroupWise 6.0 e-mail message?

In a nutshell: In Microsoft Word XP, I click a toolbar button that activates a macro. The macro runs a procedure in VBA that reads Access XP data and stores it in variables. GroupWise then fires up and a GroupWise note is sitting there all addressed and filled out waiting for me to click SEND.

Getting the data is no problem. I use the SQLRetrieveItem$(connect_num, X, 1) function. Composing the body of the letter and addressing it is no problem. What I'm looking for is the proper syntax to activate Novell GroupWise and assign the TO, SUBJECT, MESSAGE, etc. from my variables to it. I don't want it to actually send the e-mail because I want to be able to add personal comments to the message before clicking SEND.

Thanks.


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
__________________
Greg Serrano
Michigan Dept. of Environmental Quality
Air Quality Division
 
Old October 28th, 2003, 12:54 PM
sal sal is offline
Friend of Wrox
 
Join Date: Oct 2003
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Groupwise is MAPI compliant so

docmd.SendObject ObjectType,objectname,Outputformat (.doc),To,CC,Bcc,Subject,MessageText,EditMEssage(T rue/False

will work

Does this help?





Sal
 
Old October 28th, 2003, 01:15 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Which reference library must be open for DoCmd to work? Right now, when I type DoCmd., typing the period should activate the automatic phrase completion but it doesn't. And if I type docmd.sendobject with the rest and go to the next line, nothing capitalizes, signaling to me that the syntax is not being recognized.

I know DoCmd is an Access VBA thing, but is it a Word VBA thing?


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
 
Old October 28th, 2003, 01:49 PM
sal sal is offline
Friend of Wrox
 
Join Date: Oct 2003
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You may not need the docmd at all to run the code. I guess the docmd is an Access thing. I have used it by referencing the Access library, but if you user does not have access, it would not run.



Sal
 
Old October 28th, 2003, 02:16 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Sal, the combination of the DoCmd.SetObject after activating the Access reference libary worked. Thanks.


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division





Similar Threads
Thread Thread Starter Forum Replies Last Post
Vba Consolidate Syntax grouth Excel VBA 3 September 29th, 2006 07:37 PM
Syntax Needed SerranoG Access VBA 4 February 6th, 2004 06:41 PM
help with VBA syntax jacqui Excel VBA 0 January 12th, 2004 02:08 PM
Procedure Calling Syntax Needed SerranoG Access VBA 4 October 24th, 2003 07:03 AM
SQL syntax for my query - guru needed badgolfer Access 2 September 20th, 2003 01:52 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.