Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / February 2004

Tip: Looking for answers? Try searching our database.

vba to save word doc as

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
kevin.witty@snet.net - 04 Feb 2004 18:08 GMT
I've used Albert D. Kallal's brilliant Merge20 to help me create a word
merge document, which ends up named "Form Letters 1".  I can't figure out
the sytax to save that doc with a new name from within vba in Access.  (In
fact I can't figure out how to do much of anything with Word vba since I get
no intellisense there, and I can't find where it's documented!!)  If anyone
can help me with the sytax, I'll appreciate it.  If anyone can pint to where
the documentation is, or how to get intellisense turned on I may not have to
ask questions like this again <g>.  Thanks, Kevin
Doug Robbins - Word MVP - DELETE UPPERCASE CHARACTERS FROM EMAIL ADDRESS - 05 Feb 2004 07:24 GMT
Hi Kevin,

I would be more certain about this is you had pasted the actual bit of
Albert's code that you are using.  I have taken a guess however and after
the following lines of code:

  WordApp.Visible = True
  WordApp.Windows(WordApp.Windows.Count).Activate

  clsRidesPBar.HideProgress

  AppActivate "Microsoft Word"
  WordApp.WindowState = 0  'wdWindowStateRestore

you should add

   WordApp.ActiveDocument.SaveAs "filename"

You don't get the intellisense because Albert's code uses late binding which
has the advantage that it makes the code independent of the version of Word.

If you use early binding, you will get intellisense, but you will have to
set a reference to the Word Object Model.

Signature

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested.  Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.
Hope this helps
Doug Robbins - Word MVP

> I've used Albert D. Kallal's brilliant Merge20 to help me create a word
> merge document, which ends up named "Form Letters 1".  I can't figure out
[quoted text clipped - 8 lines]
> to
> ask questions like this again <g>.  Thanks, Kevin
kevin.witty@snet.net - 05 Feb 2004 18:30 GMT
Thanks, Doug... good guess about where I was, and it worked a treat.

Where is this stuff documented?  Or, can I write the code using late binding
and intellisense, and then switch to early binding when it works (assuming I
don't use stuff which doesn't belong in both models?)  I have a references
set to both Access 10 and Word 10 but don't know how to dim an object to use
intellisense with them, and MS's Help, of course, doesn't.
Cindy M  -WordMVP- - 06 Feb 2004 10:47 GMT
> Or, can I write the code using late binding
> and intellisense, and then switch to early binding when it works

I think you mean it the other way around :-) Early binding to see the
intellisense; late binding to make the module "independent".

>I have a references
> set to both Access 10 and Word 10 but don't know how to dim an object to use
>  intellisense with them

Dim Wordapp as Word.Application

I'm not certain that you need Access? I'm not familiar with the code you're
referencing, but I'd be more inclined to think you need a reference to dAO or
perhaps ADO.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.