Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / VS Tools for Office / May 2006

Tip: Looking for answers? Try searching our database.

Word application with cached data

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Marchionni Daniele - 19 May 2006 16:05 GMT
I'm developing a word application with cached data. The application can
modify the data with the cached attribute. When I save the document the data
seems to be updated, but if i close and reopen the document I got an old
version of the cached data.
For example I create a VSTO Word Project with a string with the cached
attribute. In the Startup event I save the document and in the BeforeSave
event I increment the data and show it. Like the code shown below:

Public Class ThisDocument
   <Cached()> Public TestString As String
   Private Sub ThisDocument_BeforeSave(ByVal sender As Object, ByVal e As
Microsoft.Office.Tools.Word.SaveEventArgs) Handles Me.BeforeSave
       If TestString Is Nothing Then
           TestString = "1"
       Else
           TestString = (CInt(TestString) + 1).ToString
       End If
       MsgBox(TestString)
   End Sub
   Private Sub ThisDocument_Startup(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Startup
       Me.Save()
   End Sub
   Private Sub ThisDocument_Shutdown(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Shutdown
   End Sub
End Class

If I open, close, reopen, reclose,... the word document the data shown is
correct.
But if I Save the document from word, the data seems to be correct, when i
close the document and reopen it the data is obsolete.

Can anyone help me?

Thanks in advanced,
Marchionni Daniele
Marchionni Daniele - 22 May 2006 14:33 GMT
I try to explain better.

The data with cahced attribute in a SmartDoc aren't saved after a call to
Document.Save().
They are saved the first time I call Save but not anymore after, even
using Ctrl-S or File/Save.
The content of the document is saved in all cases.

Regards.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
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.