コード例 #1
0
        public static void Run()
        {
            string inputfile = "doc-sample3.doc";

            // Upload input file from local directory to Cloud Storage
            Common.UploadFile(inputfile, string.Empty);

            // Get All Merge Field Names from a Word Document
            WordsFieldNamesResponse wordsFieldNamesResponse = Common.WordsService.WordsMailMerge.ReadDocumentFieldNames(inputfile, true, Common.FOLDER);

            Console.WriteLine("\n" + inputfile + " have " + wordsFieldNamesResponse.FieldNames.Names.Count + " Merge Field");
        }
コード例 #2
0
        public void Words_MailMerge_Tests()
        {
            try
            {
                storageService.File.CopyFile(Utils.CloudStorage_Input_Folder + "/doc-sample3.doc", Utils.CloudStorage_Output_Folder + "/doc-sample3.doc");
                WordsFieldNamesResponse wordsFieldNamesResponse = wordsService.WordsMailMerge.ReadDocumentFieldNames("doc-sample3.doc", true, Utils.CloudStorage_Output_Folder);

                WordsDocumentResponse wordsDocumentResponse = wordsService.WordsMailMerge.ExecuteDocumentMailMergeOperation("doc-sample3.doc", true, Utils.CloudStorage_Input_Folder + "/word-mailmerger-data.xml", string.Empty, string.Empty, Utils.CloudStorage_Output_Folder);

                storageService.File.DownloadFile(Utils.CloudStorage_Output_Folder + "/" + wordsDocumentResponse.Document.FileName, Utils.Local_Output_Path + "/" + wordsDocumentResponse.Document.FileName);
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.Message);
            }
        }