Visual Studio User Group

   ホーム      
 | 
  
   イベント      
 | 
  
   フォーラム      
 | 
  
   VSUG キャスト      
 | 
  
   記事      
 | 
  
   About VSUG   
会員サービス
メンバー ログイン
新規会員登録はこちら
MENU
ホーム
イベント
VSUG アカデミー
VSUG Day
Bar VSUG
過去のイベント
フォーラム
初心者フォーラム
Visual Studio
.NET 開発
プラットフォーム運用
フリートーク・お知らせ
フォーラムの利用案内
VSUG キャスト
第 1 回 近藤 和彦 氏
第 2 回 長沢 智治 氏
記事
連載
コラム
About VSUG
VSUGとは
フォーラムリーダー紹介
ガジェット
スタッフ日記
フォーラムグループ
初心者フォーラム
初心者なんでも相談室
Visual Studio
Visual Studio 2005
Visual Studio 旧環境
.NET 開発
Visual Basic
Visual C#
Visual C++/CLI その他
Web アプリケーション
リッチクライアント・UI コントロール
データベース・データアクセス
モバイル・スマートクライアント
.NET Framework
開発プロセス
マイグレーション・COM 相互運用
Office 開発・VSTO
Web ホスティングアプリケーション
ライティング・セキュアコード
プラットフォーム運用
運用管理
フリートーク・お知らせ
談話室
VSUGからのお知らせ
フォーラムの利用案内
インフォメーション
会員規約
会員登録
プライバシーポリシー
リンクポリシー
著作権について
スポンサーについて
お問い合わせ
オンライン状態
オンライン状況 オンライン状態:
未登録ユーザー 未登録ユーザー: 210
登録ユーザー 登録ユーザー: 0
計 計: 210

オンライン中のユーザー オンライン中のユーザー:

 
  VSUG フォーラム  .NET 開発  Office 開発・VSTO  編集中のWord文書の総ページ数を知りたいのですが
前へ 前へ
 
次へ 次へ
新しい投稿 2009/07/22 21:23
ユーザーはオフラインです。 めっぱつ
1件の投稿
ランキングデータがありません


編集中のWord文書の総ページ数を知りたいのですが 
言語:C# / Ver:2005 / プラットフォーム:Windows XP
以下の様にC#にてWordファイルを開き、他のWord文書を挿入した後に現在の総ページ数を知りたいのですがどうすればよいでしょうか。(Wordファイル保存前に)
ちなみに
Word2003を使用しています。
VisualStudio2005StandardEditionを使用しています

using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.IO;
using System.Drawing;
using iWordS = Microsoft.Office.Interop.Word;

namespace ManualDB
{
static class MainP
{
[STAThread]
static void Main()
{
object oMissing = System.Reflection.Missing.Value;
iWordS._Application oWord = new iWordS.Application();
iWordS._Document oDoc;
iWordS.Selection WordSec;

Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
object oFileName = @"C:\Test.Doc";
object oReadOnly = false;
oDoc = oWord.Documents.Open(ref oFileName, ref oMissing,
ref oReadOnly, ref oMissing,
ref oMissing, ref oMissing,
ref oMissing, ref oMissing,
ref oMissing, ref oMissing,
ref oMissing, ref oMissing,
ref oMissing, ref oMissing,
ref oMissing, ref oMissing
);
WordSec = oDoc.ActiveWindow.Selection;
WordSec.InsertFile(@"C:\TestA.Doc", ref oMissing, ref oMissing, ref oMissing, ref oMissing);
WordSec.InsertFile(@"C:\TestB.Doc", ref oMissing, ref oMissing, ref oMissing, ref oMissing);

Console.WriteLine("ファイル保存前に総ページ数を知りたい");

object bNoPrompt = true;
oWord.Documents.Save(ref bNoPrompt, ref oMissing);
oWord.Quit(ref oMissing, ref oMissing, ref oMissing);
}
}
}
 
 1/1ページ
前へ 前へ
 
次へ 次へ
  VSUG フォーラム  .NET 開発  Office 開発・VSTO  編集中のWord文書の総ページ数を知りたいのですが
ログイン | © Visual Studio User Group. All rights reserved. 著作権について | プライバシーポリシー | リンクポリシー | お問合せ