Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

DDE - SaveAs in Word

Posted on 1999-07-16
7
Medium Priority
?
804 Views
Last Modified: 2012-08-14
I'm making a project in Access. And I need to send a SaveAs command to Word through a DDE channel. I know how to open the channel and things like that. All I need is the the SaveAs command, I need to pass along a paht that the current document is going to be saved to.
0
Comment
Question by:Olli083097
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 13

Expert Comment

by:cri
ID: 1609316
Olli,
It is not the answer you are seeking, put perhaps it could suit you better. In the issue 4.29 of "woody's office watch" which I received today, Helen Fedema (seems to be a true Access guru) gives an example of, which, I quote from the description:

"In fact, I can even create a document (or template) from code, and put the doc properties into it, before creating a new document from the template, eliminating the need to distribute a Word template with the Access app, and any possible problems resulting from the user placing the template in the wrong location. "

If this interest you, I can give you more, otherwise disregard it.

\cri
0
 
LVL 5

Expert Comment

by:vboukhar
ID: 1609317
You can do that using Word object from VBA. Look as sample below (Word95; I guess, it could run at Word97 too. If not - try to use CreateObject("Word.Application"), .Open  and .SaveAs commantd instead of .FileOpen and .FileSaveAs)
Sub WordTest()
    Dim WordObj As Object
    Set WordObj = CreateObject("Word.Basic")
    WordObj.AppHide "Microsoft Word"  ' hide Word
    WordObj.FileOpen "d:\old_one.doc"   ' open your file
    WordObj.FileSaveAs "D:\new_one.doc" ' string with new path/name
    WordObj.AppClose "Microsoft Word" ' close Word
    Set WordObj = Nothing
End Sub
Hope it helps.
P.S. It's not DDE, though...
0
 
LVL 3

Expert Comment

by:knowme
ID: 1609318
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 4

Expert Comment

by:NickRackham
ID: 1609319
Olli

If you only need the command for SaveAs in Word and you've already got the document open then the following will do the trick.

Sub Saveas()
ActiveDocument
Dialogs(wdDialogFileSaveAs) = "C:\Your Directory"
End Sub

Regards

Nick
0
 
LVL 5

Accepted Solution

by:
vboukhar earned 120 total points
ID: 1609320
Olli!
Look at sample below - it's open Wimword document via DDE channel and save it with new name. You can create string with desirable path and call it.
Sub wordDDE()
channelnumber = Application.DDEInitiate(app:="WinWord", topic:="System")
Application.DDEExecute channelnumber, "[FILEOPEN .Name = " & Chr(34) & "D:\ONE.DOC" & Chr(34) & "]"
Application.DDEExecute channelnumber, "[FILESAVEAS " & Chr(34) & "D:\TWO.DOC" & Chr(34) & "]"
Application.DDETerminate channelnumber
End Sub
All above - for Winword95 (for Winword97 maybe you have to use Open and SaveAs commants. But main idea - usage of chr(34) to create string for DDE command.)
Hope it hepls.
0
 
LVL 5

Expert Comment

by:vboukhar
ID: 1609321
Hi, Oli!
Do you remember yet about this your question?
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6872902
GREETINGS!

This question was awarded, but never cleared due to the JSP-500 errors of that time.  It was "stuck" against userID -1 versus the intended expert whom you awarded.  This corrects the problem and the expert will now receive these points; points verified.

Please click on your Member Profile and select "View Question History" to navigate through any open or locked questions you may have to update and finalize them.  If you are an EE Pro user, you can also choose Power Search to find all your open questions.

This is the Community Support link, if help is needed, along with the link to All Topics which reflects many TAs recently added.

http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
http://www.experts-exchange.com/jsp/zonesAll.jsp
 
Thank you,
Moondancer
Moderator @ Experts Exchange
0

Featured Post

Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Cancel future meetings from user mailboxes in Office 365 using Remove-CalendarEvents
New style of hardware planning for Microsoft Exchange server.
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question