-
April 28th, 2014, 05:28 PM
#1
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.
-
April 30th, 2014, 02:32 PM
#2
Re: MS Word 2013 or Windows 8.1 coerces SaveAs path to user's Documents directory
Does that folder exist on both machines?
-
May 5th, 2014, 04:45 PM
#3
Re: MS Word 2013 or Windows 8.1 coerces SaveAs path to user's Documents directory
Originally Posted by dglienna
Does that folder exist on both machines?
Yes (my program creates the folder if it does not already exist).
-
May 8th, 2014, 01:13 AM
#4
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.
-
May 17th, 2014, 01:51 AM
#5
Re: 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
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
Last edited by firoz.raj; May 17th, 2014 at 01:55 AM.
-
August 6th, 2014, 11:26 AM
#6
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:
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:
Doc.SaveAs "c:\evolvit\dgtest\out_a.doc"
Did you ever find the problem?
Matt
-
August 7th, 2014, 05:09 AM
#7
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
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|