MS Word 2013 or Windows 8.1 coerces SaveAs path to user's Documents directory
I have a VB6 program that allows use of a created object instance of MS Word to produce letters and automatically save them in the appropriate directory as determined by my program, for example:
objMSWordDocument.SaveAs C:\DISC\VER70\LOAN\DATA2\2\3\00049323.01\LETTERS\20140428124003.docx , wdFormatXMLDocument
This works as designed on one machine running Windows 8.1 Professional 64-bit, but on another identical machine, instead of silently saving the document to the specified location, a Save Dialog opens that points to the Windows user's Documents directory.
I assume this is a permissions issue, either in MS Word 2013, or Windows 8.1. My program is set to Run as Administrator.
Re: MS Word 2013 or Windows 8.1 coerces SaveAs path to user's Documents directory
Does that folder exist on both machines?
Re: MS Word 2013 or Windows 8.1 coerces SaveAs path to user's Documents directory
Quote:
Originally Posted by
dglienna
Does that folder exist on both machines?
Yes (my program creates the folder if it does not already exist).
Re: MS Word 2013 or Windows 8.1 coerces SaveAs path to user's Documents directory
Issue a CD command, and then save it. That might be the issue.
Re: MS Word 2013 or Windows 8.1 coerces SaveAs path to user's Documents directory
Quote:
I have a VB6 program that allows use of a created object instance of MS Word to produce letters and automatically save them in the appropriate directory as determined by my program, for example:
objMSWordDocument.SaveAs C:\DISC\VER70\LOAN\DATA2\2\3\00049323.01\LETTERS\20140428124003.docx , wdFormatXMLDocument
try to save your word doucumnet at the following way . hope it might help .
Code:
Private Sub MakeWordDoc(ByVal file_name As String, ByVal _
title As String, ByVal body As String)
Dim word_app As Word.Application
Dim word_doc As Word.Document
' Open Word and create a document.
Set word_app = New Word.Application
Set word_doc = _
word_app.Documents.Add(DocumentType:=wdNewBlankDocument)
' Write the title.
word_app.Selection.TypeText title
word_app.Selection.Style = _
ActiveDocument.Styles("Heading 1")
word_app.Selection.TypeParagraph
' Write the body.
word_app.Selection.TypeText body
' Save the file.
word_doc.SaveAs FileName:=file_name
' Close the document and Word.
word_doc.Close False
word_app.Quit False
End Sub
Re: MS Word 2013 or Windows 8.1 coerces SaveAs path to user's Documents directory
I'm getting the same problem on 2 Windows 8.1 PCs. One has Word 2013, the other Word 2007.
When calling saveas, word will instead open a dialog in the users documents folder.
The software I was using was an application written in vb.net express, however, I've rewritten it as a simple short vbs file, and I get the same thing. The vbs file look slike this:
Quote:
Dim Word, Doc, rngEnd
Const wdFormatDocument = 0
set Word = CreateObject("Word.Application")
Word.visible = True
set Doc = Word.Documents.Add
set rngEnd = Doc.Range(Doc.Range.End - 1, Doc.Range.End)
rngEnd.InsertFile("c:\evolvit\dgtest\a.doc")
Doc.SaveAs "c:\evolvit\dgtest\out_a.doc", wdFormatDocument, False, "", True, "", False, False, False, False, False
The same happen if I change the last line to simply be:
Quote:
Doc.SaveAs "c:\evolvit\dgtest\out_a.doc"
Did you ever find the problem?
Matt
Re: MS Word 2013 or Windows 8.1 coerces SaveAs path to user's Documents directory
I've fixed this now. It was caused by a Word com addin called "Acer Cloud World". Disabling that addin made the problem go away.
Matt