UWP (Windows PC) open a word Doc for review, sign and save the docx

Paul Ryan 331 Reputation points
2023-06-28T23:01:31.27+00:00

C# UWP using VS2022 Word version 2305

I create a word Doc using SyncFusion, (no issues), save it to a BLob (no issues)

Write a copy of the Doc to the "AppData......" dir --No issues

Open the Doc in the "AppData " dir using

await Windows.System.Launcher.LaunchFileAsync(file) -- no problem

I sign the doc and close it the edits are not reflected in the doc ( I did a simple edit -Save , the edit is not saved)

 private async void SaveDocLocal()
        {
            string thFolder         = Path.Combine(ApplicationData.Current.LocalFolder.Path, FileNames.DocToBlobDir);
            var folder              = StorageFolder.GetFolderFromPathAsync(thFolder).GetAwaiter().GetResult();
            StorageFile file        = folder.CreateFileAsync(fileName,
                CreationCollisionOption.ReplaceExisting).GetAwaiter().GetResult();
            var stream              = file.OpenStreamForWriteAsync().GetAwaiter().GetResult();
            examNewDoc.Save(stream, FormatType.Docx);
            stream.Close();

            DocsWriteToBlobModel dwM = new()
            {
                LocalPath = file.Path
            };
            dwM.MTime                   = File.GetLastAccessTime(dwM.LocalPath);
            dwM.BlobPrefix              = prefixBlobNameDoc;
            SFiles.DocsToWriteToBlob.Add(dwM);

           await Windows.System.Launcher.LaunchFileAsync(file);
            
        }
   
Developer technologies | Universal Windows Platform (UWP)
{count} votes

1 answer

Sort by: Most helpful
  1. Paul Ryan 331 Reputation points
    2023-06-29T11:08:25.1933333+00:00

    My Stupid,

    I had two Dirs (DocToBlob and tempDir), when viewing I was pulling from the "tempdir", when editing I was in "DocToBlob"

    thank you and sorry to waste your time


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.