问题列表 - 第38729页

如何使用VBA在Outlook的当前打开窗口中获取对邮件项的引用?

我有一个宏可以很好地放入文件夹/应用标志/设置类别,但它只适用于在资源管理器中选择的当前项目.

当我在桌面上收到电子邮件警报并单击它以打开电子邮件时,我希望能够针对该打开的项目运行相同的宏,但是我找不到任何关于如何访问该对象的文档与访问资源管理器列表中所选项目的方式类似.

我当前的选择逻辑如下所示:

Dim Item As Object
Dim SelectedItems As Selection

Set SelectedItems = Outlook.ActiveExplorer.Selection
For Each Item In SelectedItems
    With Item
        'do stuff
    End With
Next Item
Run Code Online (Sandbox Code Playgroud)

vba outlook-vba outlook-2007

7
推荐指数
2
解决办法
1万
查看次数

Java对象数组和继承

我有3个类,具有主要方法的MainClass,一个名为AbstractClass和Subclass的抽象类,将通过AbstractClass进行扩展。

对象数组是在main方法中从包含1个成员的AbstractClass类型创建的。然后,我将数组的1个元素初始化为Subclass类型(可以吗?)。问题是我无法使用创建的对象(array [0])的getDataToExport()方法。我怀疑出现问题是因为数组是AbstractClass类型...而问题是:这是否有可能实现?我想做的是使用类型为AbstractClass的数组,并用由不同的子类(在此代码中仅是一个-> Subclass)制成的对象填充它,但该类继承了AbstractClass,但我无法使用该子类的方法。

主类与主方法

public class MainClass {

    public static void main() {

        AbstractClass array[]=new AbstractClass[1];
        array[0]= new Subclass(); // is this even allowed?
        System.out.println(array[0].getDataToExport()); // Problem!

    }

}
Run Code Online (Sandbox Code Playgroud)

抽象类

public abstract class AbstractClass {

}
Run Code Online (Sandbox Code Playgroud)

扩展AbstractClass的子类

public class Subclass extends AbstractClass {

    private int dataToExport;

    public Subclass(){
        this.dataToExport=2;
    }

    public int getDataToExport() {
        return dataToExport;
    }   

}
Run Code Online (Sandbox Code Playgroud)

java arrays inheritance object

2
推荐指数
1
解决办法
1万
查看次数

如何从win32应用程序中的命令行参数获取std :: string?

所以现在我有一个

int main (int argc, char *argv[]){}

如何使它基于字符串?会int main (int argc, std::string *argv[])够的吗?

c++ string command-line arguments std

5
推荐指数
2
解决办法
1万
查看次数

什么是C#5,它来自哪里?

我知道C#3.5与VS2008和.NET 3.5一起使用.
此外,C#4是VS2010和.Net 4.0的一部分.
但什么是C#5?什么IDE?

.net c# visual-studio

52
推荐指数
4
解决办法
3万
查看次数

在ms访问中将记录插入表中

我需要使用ms access 2007创建一个小的"应用程序".我只需要创建一个表单来处理与几个db表相关的输入/输出.我创建了表格:患者,治疗和实验.

患者表中的主键是ID,它在治疗和实验表中用作外键,其名称为patientID.

我还创建了一个我在本期问题开头提到的表格.它有多个标签.第一个选项卡打开/创建患者,第二个选项卡用于输入要输入到实验表中的数据.同样适用于治疗表.

我的问题: I added a button to the 2nd tab, and I want to attach an 'action' that will set an INSERT query with values taken from fields (controls) in tab 2, together with ID field taken from tab1 (that corresponds with patient ID from patients table), and then execute a query.

现在我正在努力实现这一目标,但收效甚微.此外,在MS网站上搜索解决方案有点难,因为它总是显示其中包含"查询"的结果:)...而查询不是我想要使用的smt.(但是,我会接受任何解决方案).

谢谢

表:

耐心

ID - primary key, autogenerated
patientID - internal number of the patient record. I could've used this, but it would …
Run Code Online (Sandbox Code Playgroud)

forms ms-access-2007

1
推荐指数
1
解决办法
1万
查看次数

iOS:UIButton根据文本长度调整大小

在界面构建器中,按住Command+ =将调整按钮的大小以适合其文本.我想知道在按钮添加到视图之前是否可以以编程方式执行此操作.

UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
[button.titleLabel setFont:[UIFont fontWithName:@"Arial-BoldMT" size:12]];
[button addTarget:self action:@selector(buttonTapped:) forControlEvents:UIControlEventTouchUpInside];
// I need to know the width needed to accomodate NSStringVariable
[button setTitle:NSStringVariable forState:UIControlStateNormal]; 
// So that I can set the width property of the button before addSubview
[button setFrame:CGRectMake(10, 0, width, fixedHeight)];
[subNavigation addSubview:button];
Run Code Online (Sandbox Code Playgroud)

uibutton ios

126
推荐指数
11
解决办法
13万
查看次数

如何检查遥控器中是否存在文件?

有没有办法检查遥控器中是否存在指定的相对路径下的文件?如果它是唯一的选择,我可以先获取信息.换句话说,我正在寻找带有指定远程和分支选项的git-ls文件.我只对文件存在感兴趣(分支上的文件列表也会这样做),我不关心哈希,差异等.

git git-remote

15
推荐指数
2
解决办法
1万
查看次数

你的javadocs被编译成你的类文件吗?

编译java文件时,是否还将javadoc和注释嵌入到类文件中?

例如,如果你有大型的javadoc,它是否会影响你的类文件的整体大小?抑或是编译器忽略开头一切///*

java compiler-construction

9
推荐指数
3
解决办法
2993
查看次数

如果使用不同的用户凭据,为什么Process.Start会抛出Win32Exception?

我需要以另一个用户开始一个进程,这是一个轰炸.

我将我的代码缩减为一个简单的参考示例.此代码可以正常启动进程:

        var info = new ProcessStartInfo("notepad.exe")
                       {
                           UseShellExecute = false,
                           RedirectStandardInput = true,
                           RedirectStandardError = true,
                           RedirectStandardOutput = true
                       };
Run Code Online (Sandbox Code Playgroud)

但是,如果我添加UserNamePassword值:

       var info = new ProcessStartInfo("notepad.exe")
                       {
                           UserName = "user",
                           Password = StringToSecureString("password"),
                           UseShellExecute = false,
                           RedirectStandardInput = true,
                           RedirectStandardError = true,
                           RedirectStandardOutput = true
                       };
        Process.Start(info);
Run Code Online (Sandbox Code Playgroud)

它轰炸了一个非常有用的System.ComponentModel.Win32Exception消息:

无法启动该服务,因为它已被禁用,或者因为它没有与之关联的已启用设备.

以防万一,这是安全字符串转换方法:

    private static SecureString StringToSecureString(string s)
    {
        var secure = new SecureString();
        foreach (var c in s.ToCharArray())
        {
            secure.AppendChar(c);
        }
        return secure;
    }
Run Code Online (Sandbox Code Playgroud)

任何想法或替代解决方案将非常感谢!

c# process

3
推荐指数
1
解决办法
2639
查看次数

尝试使用MASM32会破坏我的电脑吗?

在我的电脑上玩一点可以安全吗?我有这种预感,在编写一些实验代码时我会犯一个可怕的错误.我的恐惧毫无根据吗?


编辑

感谢您的快速回复并澄清了我的担忧.我想我不必太担心它.如果我想做一些危险的实验,我将准备一个虚拟机环境.再次感谢!

assembly masm32

1
推荐指数
3
解决办法
449
查看次数