用VBA取得WORD当前光标所在位置的行号列号和页数

c#实现VSTO 在光标处填充内容                 Microsoft.Office.Interop.Word.Document doc = Globals.ThisAddIn.Application.ActiveDocument;//获取当前最新一个打开的文档                 Selection focusSelect = Globals.ThisAddIn.Application.Selectio... 阅读详情

MsgBox   "The   selection   is   on   page   "   &   _ 
                Selection.Information(wdActiveEndPageNumber)   &   ";   Column   "   _ 
                &   Selection.Information(wdFirstCharacterColumnNumber)   &   _ 
                ";   Line   "   _ 
                &   Selection.Information(wdFirstCharacterLineNumber) 

vsto光标定位 对编辑区的鼠标焦点定位,使用的是C#语言,HomeKey():回到当前文档开头 EndKey():回到当前文档的尾部 GoTo():查找 MoveDown():向下移动 MoveUp ():向上移动 立即下载

相关推荐

VBA获取模块鼠标光标所在的行数.txt

获取模块鼠标光标所在的行数,一般用于写VBE代码助手时使用,想智能把代码插入到当前鼠标所在行,达到快速书写代码的目的

Word VBA: 按照章节号进行查找、跳转、选择,以及章节号比较

Word自带的查找章节号功能并不好用,有时甚至有些莫名其妙。当文档篇幅很大时,以下几个VBA函数可以高效处理文档工作。

TomasZh的博客 1383

Word VBA获取光标的位置.txt(源码)

利用Word Selection对象获取光标的位置属性:所在页、所在段落、所在行、所在列

[图解]在输入框和文本框中获取和设置光标位置,以及选中文本和获取选中文本值的方法 --- 详解,兼容所有浏览器。...

写在前面 最近在segmentfault上看到它的日期输入控件,感觉挺有意思。好吧,动手写一个,加到自己的代码库里吧。 然后问题来了,在上面图片中,我们很明显的看得出这里涉及光标位置的控制。比如说当我输入1993的3之后,光标必须要得插入到-中划线的下个输入点。 在网上找了找获取和设置光标位置的方法,发现是资料是相当的破碎,并没有一个详细的介绍。 所以我来一个详细的。 好了,不要啰...

weixin_34233679的博客 841

网格聚类 Grid Clustering/Grid-based Clustering

本文主要简单介绍了网格聚类的基本概念,优缺点,应用场景,建模时的注意事项,评价指标,实现方法,python示例和模型参数等。

JasonH2021的博客 4828

Jetson Nano官方镜像下载&烧录

在NVIDIA Jetson Nano开发者套件上安装NVIDIA官方Ubuntu镜像

weixin_44222088的博客 8851

怎么得到焦点所在的单元格在表中的位置

注意:数字从0开始的!!请点击每行 aaaaaaaaaaaa bbbbbbbbb aaaaaaaaaaaa bbbbbbbbb aaaaaaaaaaaa

起跑线的专栏 941

电赛备赛笔记:用STM32驱动AD9959信号发生器模块,从接线到出波保姆级教程

本文详细介绍了如何使用STM32驱动AD9959信号发生器模块,从硬件接线到软件调试的全流程。AD9959作为高性能DDS芯片,适用于电子设计竞赛中的信号生成需求。文章包含硬件连接指南、寄存器配置解析、多通道控制技巧以及常见问题解决方案,帮助参赛者快速掌握AD9959的应用。

weixin_31858171的博客 367

在word中用vba为选中区域自动添加行号或删除行号

需求说明 用word编辑文档时,希望快速为选中内容添加行号或删除行号。如果手动来做,当行数很多时,就会比较麻烦,这时VBA就可以派上用场。 vba源码 '为选中内容添加行号 Sub 添加行号() ' n = 0 Dim selectdRange As Range Set selectdRange = Selection.Range ...

littlezhuhui的专栏 2018

BitLocker恢复密钥丢失?从原理到实战的完整解锁与系统重生指南

磁盘加密技术是数据安全的核心防线,它通过对存储设备上的数据进行编码,确保未经授权的用户无法访问。其原理主要基于加密算法(如AES)与密钥管理机制,在操作系统启动前或数据读写时进行实时加解密。这项技术的核心价值在于防止设备丢失或被盗后的数据泄露,尤其对于笔记本电脑和移动设备至关重要。典型的应用场景包括企业办公电脑、存有敏感信息的个人设备以及符合合规性要求的行业。当使用Windows系统自带的BitLocker加密功能时,若因硬件改动、系统更新等触发保护机制,用户可能会面临需要输入恢复密钥才能启动的困境。本文聚

weixin_34006965的博客 489

ICM20948 DMP代码详解(69)

ICM20948 DMP代码详解(69)

phmatthaus的专栏 617

java读取word页码_VBA代码读取word文档页脚

我有一个完整的word文档表单的文件夹,我有一个excel文件,将表单上的所有答案读入电子表格中的不同工作表 . 导出数据的工作表取决于word文档的文件名 .这目前工作正常 .但是,我现在需要它能够考虑存储在word文档页脚中的表单的版本号,但我不知道如何引用它 .对于VBA来说,我是一个非常棒的人,所以没有尝试过多少 .我尝试过的VBA可以在下面找到,但不出所料 .Sub ReadWordDo...

weixin_33280675的博客 470

EMB电子机械制动系统和EHB电子液压制动系统控制功能的对比

EMB电子机械制动系统相比EHB液压制动系统具有显著优势:响应速度更快(<100ms)、控制精度更高(±2N·m)、能实现单轮独立控制,支持0.1%级制动力调节。在ABS、ESC等安全功能上表现更优,制动平顺性和NVH性能更好,同时提升能量回收效率15%-20%。特别适合智能驾驶需求,可使AEB等系统响应时间缩短50ms,紧急制动距离减少1米以上。EMB系统完美契合高阶自动驾驶对快速响应和精准控制的要求。

m0_59012156的博客 885

Word VBA中的光标操作

本文总结了Word VBA中的Selection常用操作,包括移动光标、查找和替换、输入内容、获取其他相关对象等,并附上了Information方法的参数详细说明。本文绝非简单照抄MSDN文档,而是包含了一些有一定难度的实用代码片段。

yivifu的专栏 1万+

塔石DTU通过MQTT传递数据教程

塔石通过MQTT通讯上传ADL400电表用电量。

renkai721的专栏 253

新手必看!一步步教您如何获取可用的D音Cookie(为什么我复制的D音Cookie无法正常使用?)

新手必看!一步步教您如何获取可用的抖音Cookie(为什么我复制的抖音Cookie无法正常使用,无法下载无水印视频?)

XiaoqiangClub的博客 1491

VBA获取WORD数据

【代码】VBA获取WORD数据。

豪情云天博客,分享经典好用代码,和工具,感谢大家的关注和支持! 721

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

VSTO对象操作 一

一、如何控制当前光标1、获取和设置光标位置        Application.Selection.Start    Application.Selection.End       当在计算或者使用程序初始化Word时,随时获取当前光标位置,可用Application.Selection.Start获取。2、判断是否选取文字       Application.Selection.Text    表示Word中,是否有被选中的反显的文字。    Application.Selection.Text. Le

tianyu0910的专栏 3598

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Camera2Demo

在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作

Word VBA

1. 取得当前页的页码 selection.Information(wdActiveEndPageNumber)

ppby2002的专栏 1042

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

Word页脚设置“第X页共X页”的方法【域实现】

作者: @bushuo联系方式: 3513566868@qq.com。

qq_50930131的博客 4614

用程序获取word页码方法汇总

背景说明 最近参与了一个档案管理系统,使用java开发,部署在centos,其中的一个功能需要获取到word文件准确的页码,现在将尝试过的方法汇总如下: Java Apache POI C# Microsoft.Office.Interop.Word.Application Python oletools Apache POI 由于系统是java开发的,所以首先尝试了poi,但是获取的页码不准确,所以这个方案放弃掉了。poi操作word的例子很多,这里就不上示例代码了。 C# Microsoft.Off

雷动专栏 2766

word vba 控制光标常用代码

‘ Selection.MoveDown Unit:=wdLine, Count:=1'光标下移一行 ’选中光标所在行 With Selection .HomeKey Unit:=wdLine, Extend:=wdExtend .MoveEnd Unit:=wdLine, Count:=1 End With 移动光标至文档开...

ssson的专栏 8681

word vba 读出光标所在的列数_一键调整WORD段落、表格

这次推的小工具关注公众号[茶瓜子的休闲馆]后回复[排版]获取小工具的下载地址。1、批量调整列宽我在后期对文档排版的时候,就想做一个这样的表格列宽刷出来,因为我们经常会有这样的场景:将两个或多个表格调整为一样的列宽。之前我的方法就是将目标表的每一列列宽值复制到需要调整的表格中(你是不是还在一列列的拖动列宽),但是这样人工做效率真的太低了,而且word文档一大就非常的卡,所以有点时间了就赶紧把这个功能...

weixin_39928099的博客 853

VBA操作WORD(四):获知关键字所在段落及相关信息

代码如下: Sub 关键字所在的段落() With Selection .HomeKey unit:=wdStory, Extend:=wdMove If .Find.Execute(FindText:="关键字", Forward:=True) Then '.HomeKey unit:=wdStory, Extend:=wdExtend MsgBox (.Range.Paragraphs.Count) End If

rielzhou的博客 6139
上一篇: 管理之道
下一篇: sqlite3: 一个SQLite数据库的命令行接口
wolfwaretech
博客等级 码龄16年 10粉丝 20原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值