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 April 14th, 2005, 10:31 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 141
Thanks: 1
Thanked 0 Times in 0 Posts
Default Word VBA question

Hi All,

I am trying to create Envelopes and Labels by accessing
WORD COM object in Active Server Pages.

If there are some samples how to create them, they would be very helpful.

Thank you,
:)



MCinar

Love all the creatures because of the creator.
__________________
MCinar

Love all the creatures because of the creator.
 
Old April 14th, 2005, 12:19 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Open Word, do the things that you want to accomplish in your application while recording a macro, then go to the VBA editor to see what the syntax is to accomplish that.

Then adapt that code to your application.

Brian

Love the Creator because of what His creation tells us about Him.
 
Old April 14th, 2005, 02:49 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 141
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Thank you, Brian.

MCinar

Love all the creatures because of the creator.
 
Old April 15th, 2005, 08:36 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 141
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Hi Brian,

I created a macro and captured the code. Then I applied the code in Active Server Pages.
It seems like the syntax is different in ASP and it didn't work.

If you have some samples for ASP or if you can tell me where to get that information,
that would be very helpful.

Thanks,



MCinar

Love all the creatures because of the creator.
 
Old April 18th, 2005, 03:17 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

When you put the code into a place other than word, you must change the syntax to reflect the new home in which it finds itself.

For instance, in Word Selection.Font works. But in another location, you would need to refer to the Word instance, and the document WordApp.MyDoc.Selection.Font.

If you have another VBA application (Excel, Access, ...) or VB (which would be best), you should develop your code there, giving you intellisense in some cases, and access to the WatchWindow to examine your various objects.

Then take the result of that development, and adapt it to your .asp page(s).

Brian

Love the Creator because of the creation.
 
Old April 18th, 2005, 03:19 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

(Maybe that would be better
Code:
    Set MyDoc = WordApp.ActiveDocument
    MyDoc.Selection.Font ' . . .
    )





Similar Threads
Thread Thread Starter Forum Replies Last Post
word 2003 vba joukaniabhay VB How-To 0 February 15th, 2005 07:33 PM
vba and MS Word Earl G. Hyde VB How-To 0 December 27th, 2003 02:06 AM
Word VBA sdowen Excel VBA 4 December 3rd, 2003 04:32 PM
VBA Word gcookie79 Excel VBA 1 November 12th, 2003 01:04 PM
eventhandler in VBA for Word nesplb Pro VB 6 0 July 30th, 2003 06:26 AM





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