Hi everyone,
I have a problem here. Here is my code: - private void wa_DocumentBeforeSave(Word.Document Doc, ref bool SaveAsUI, ref bool Cancel)
-
{
-
Cancel = true;
-
SaveAsUI = false;
-
-
SaveDocumentAtSharePoint(Doc);
-
}
-
-
private void SaveDocumentAtSharePoint(Word.Document Doc)
-
{
-
object FileName = @"C:\temp\WordFile.doc";
-
object FileFormat = Word.WdSaveFormat.wdFormatDocument;
-
object LockComments = false;
-
object AddToRecentFiles = false;
-
object ReadOnlyRecommended = false;
-
object EmbedTrueTypeFonts = false;
-
object SaveNativePictureFormat = true;
-
object SaveFormsData = true;
-
object SaveAsAOCELetter = false;
-
object Encoding = Core.MsoEncoding.msoEncodingUSASCII;
-
object InsertLineBreaks = false;
-
object AllowSubstitutions = false;
-
object LineEnding = Word.WdLineEndingType.wdCRLF;
-
object AddBiDiMarks = false;
-
-
Doc.SaveAs(ref FileName,
-
ref FileFormat, ref LockComments, ref missing,
-
ref AddToRecentFiles, ref missing,
-
ref ReadOnlyRecommended,
-
ref EmbedTrueTypeFonts, ref SaveNativePictureFormat,
-
ref SaveFormsData, ref SaveAsAOCELetter,
-
ref Encoding, ref InsertLineBreaks, ref AllowSubstitutions,
-
ref LineEnding, ref AddBiDiMarks);
-
-
Doc.Saved = true;
-
}
The document is saved in the temp folder the Document is always Empty. I've done the same thing with Excel and the xls is saved correctly. I cant see what is causing this here.
Help will be really apreciated,
JMA
1 2223
I solved the problem, if you turn the AllowSubstituti ons to true the file will be saved with its content.
Hi everyone,
I have a problem here. Here is my code: - private void wa_DocumentBeforeSave(Word.Document Doc, ref bool SaveAsUI, ref bool Cancel)
-
{
-
Cancel = true;
-
SaveAsUI = false;
-
-
SaveDocumentAtSharePoint(Doc);
-
}
-
-
private void SaveDocumentAtSharePoint(Word.Document Doc)
-
{
-
object FileName = @"C:\temp\WordFile.doc";
-
object FileFormat = Word.WdSaveFormat.wdFormatDocument;
-
object LockComments = false;
-
object AddToRecentFiles = false;
-
object ReadOnlyRecommended = false;
-
object EmbedTrueTypeFonts = false;
-
object SaveNativePictureFormat = true;
-
object SaveFormsData = true;
-
object SaveAsAOCELetter = false;
-
object Encoding = Core.MsoEncoding.msoEncodingUSASCII;
-
object InsertLineBreaks = false;
-
object AllowSubstitutions = false;
-
object LineEnding = Word.WdLineEndingType.wdCRLF;
-
object AddBiDiMarks = false;
-
-
Doc.SaveAs(ref FileName,
-
ref FileFormat, ref LockComments, ref missing,
-
ref AddToRecentFiles, ref missing,
-
ref ReadOnlyRecommended,
-
ref EmbedTrueTypeFonts, ref SaveNativePictureFormat,
-
ref SaveFormsData, ref SaveAsAOCELetter,
-
ref Encoding, ref InsertLineBreaks, ref AllowSubstitutions,
-
ref LineEnding, ref AddBiDiMarks);
-
-
Doc.Saved = true;
-
}
The document is saved in the temp folder the Document is always Empty. I've done the same thing with Excel and the xls is saved correctly. I cant see what is causing this here.
Help will be really apreciated,
JMA
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Adam Knight |
last post by:
I am trying to create a word document via asp.
I keep getting this error:
Server object, ASP 0178 (0x80070005)
The call to Server.CreateObject failed while checking permissions. Access is
denied to this object.
I am running window 2000 professional with IIS 5.0 installed.
I know it is a ntfs permissions error and that IUSR_ComputerName needs
|
by: Andy |
last post by:
I am trying to do the following from an ASP.NET Web Application (C#).
User fills out a form.
The program takes those answers and merges them with a WORD document.
I have tried the few examples of launching word from my app and get ACCESS
DENIED when the Word attempts to start.
Once the merge is complete, the document gets saved and sent to the user to
open and further edit if necessary. The initial merge part doesn't have to
|
by: Joachim |
last post by:
Hi,
I want to try call/run Ms. Word via my VB.Net
First I added reference : Microsoft Word 11.0 Object Library. Then I got 2 references in my reference list : Word and Microsoft.Office.Core
When I typed :
Dim objWord as Word.Application
Dim objDocument as Word.Document
I got an error (underline at Word.Application and Word.Document).
What is actually happen ?
|
by: Howard Kaikow |
last post by:
I just visited the MSFT web site and saw the comparison/pricing of the
different VS 2005 versions.
I was looking for a statement of the system requirements for VS Pro and
VSTO, could not find.
Also, more details on the differences between VS Pro and VSTO.
For example, can VSTO be used to create a DLL, in particular, a DLL that can
be used as an ActiveX DLL with Office?
In VSTO, other than the addition of the support for Office 2003...
|
by: tigrrgrr42 |
last post by:
I am working(vb.net03and05) with word documents stored in a sql db and I am
currently bringing them from a byte array into a temp file to pop into word
and make word do its thing as a com object. Is it possible to go straight
from a byte array to document in word instead of a temp file? Also is there
a way to change the save behaviour to notify my app to pickup a binary copy
of the file or stream to save back to the sql db.
Thanks in...
| |
by: Dave |
last post by:
Apologies for the newbie question. I have created a vb.net program for
my company that is designed to work with Word Templates (about forty of
them that we commonly use) that are selected by the user and populated
(with info from an Access database) at run-time, then saved as Word
documents. The program I have coded works fine -- it does what I need
it to do. But it has two problems: (1) it runs very slowly, and (2) it
does not seem to...
|
by: Le |
last post by:
Folks,
I'm trying to do some office automation using VSTO 2005. I've verified that
..Net Programmability Support is installed for every MS Office application
and Microsoft Forms 2.0 .Net Programmability Support is also installed under
Office Tools through Office Setup. I've then installed VSTO 2005 (vstor.exe,
http://www.microsoft.com/downloads/details.aspx?familyid=f5539a90-dc41-4792-8ef8-f4de62ff1e81&displaylang=en).
After installing...
|
by: Niyazi |
last post by:
Hi,
I created application that store the data in SQL SERVER that reside on
network. The client also use this application to access the resources
provided with application. But is the client want to register new customer or
companies they will enter the information in Windows Form and the program
automaticaly creates the WORD document under specific folder under
application path. Once the empty word file created than ask user if they want...
|
by: Steve |
last post by:
I've been building an application that will merge fields in a text file with
a word template, save the resulting word file out to the user's hard drive,
and then email the file as an attachment.
The problem I'm having is that I can't delete the word file I saved at the
end of the process due to the file being locked by the email process. It
appears to take longer than the code takes to complete due to virus checking
software that...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |