这是我希望做的伪代码:
Open text File
Find "XXXXX" and Replace with "YYYY"
Save text File As
Close text file
Run Code Online (Sandbox Code Playgroud)
这就是我到目前为止所拥有的
Private Sub CommandButton1_Click()
Dim sBuf As String
Dim sTemp As String
Dim iFileNum As Integer
Dim sFileName As String
' Edit as needed
sFileName = "C:\filelocation"
iFileNum = FreeFile
Open sFileName For Input As iFileNum
Do Until EOF(iFileNum)
Line Input #iFileNum, sBuf
sTemp = sTemp & sBuf & vbCrLf
Loop
Close iFileNum
sTemp = Replace(sTemp, "DIM A", "1.75")
sTemp = Replace(sTemp, "DIM …Run Code Online (Sandbox Code Playgroud) 当使用Microsoft Outlook发送电子邮件时,我希望能够在电子邮件正文中发送文件位置和网站的超链接,我的代码中的正文是oMsg.Body.任何帮助将不胜感激.
private void button13_Click(object sender, EventArgs e)
{
//Send Routing and Drawing to Dan
// Create the Outlook application by using inline initialization.
Outlook.Application oApp = new Outlook.Application();
//Create the new message by using the simplest approach.
Outlook.MailItem oMsg = (Outlook.MailItem)oApp.CreateItem(Outlook.OlItemType.olMailItem);
//Add a recipient
Outlook.Recipient oRecip = (Outlook.Recipient)oMsg.Recipients.Add("email-address here");
oRecip.Resolve();
//Set the basic properties.
oMsg.Subject = textBox1.Text + " Job Release";
oMsg.Body = textBox1.Text + " is ready for release attached is the Print and Routing";
//Send the message. …Run Code Online (Sandbox Code Playgroud) 我正在研究Excel电子表格,当选择下拉框值时,将弹出一个图像,如果选择了另一个值,它将隐藏当前图像并弹出与选择相关的图像.我找到了一些方法,只使用工作表和使用坐标定位图像太费时间; 这不是我想要的路线.在使用StackOverflow之前我做了很多研究,到目前为止似乎没有任何工作.以下是我想要实现的目标.我试图将所有图像保留在电子表格中,这增加了另一层次的挑战,但我相信有一种方法可以做到这一点,因为excel在插入EX时会为图像分配一个数字.图9.
Sub Main()
If Range(G11).Value = "anything" Then
Picture1 show
Picture2 hide
End If
End Sub
Run Code Online (Sandbox Code Playgroud)
任何帮助是极大的赞赏.谢谢
我怎么能写代码说.
Dim xlApp As Excel.Application
Dim xlWorkbook As Excel.Workbook
Dim xlWorksheet As Excel.Worksheet
Run Code Online (Sandbox Code Playgroud)
如果一个excel工作簿已经打开然后....
Set xlApp = GetObject(, "Excel.Application")
elseif xlApp is nothing then
Set xlApp = New Excel.Application
xlApp.Visible = True
Set xlWorkbook = xlApp.Workbooks.Open("E:\InspectionCreator\InspectionSheet.xlsx")
End if
Run Code Online (Sandbox Code Playgroud)
我不希望它必须是一个特定的工作簿,我似乎无法在互联网上找到任何工作簿.任何帮助都是极好的.
无论如何使用vba创建更圆润/专业的按钮.我找到了一些建议使用图像的地方,这不是一个可怕的想法,但我想知道是否有人有线索,如果有可下载的软件,加载项,或任何东西.目前可用的程序使我的程序看起来像Mid 90的应用程序.我非常感谢你的帮助.我的意思是看看!!

无论如何,要保存整个工作簿作为Excel中的pdf.我发现了这个,http://msdn.microsoft.com/en-us/library/bb407651(v = office.12).aspx,但它并没有完全告诉你它是否将整个工作簿保存为pdf或只是活动表.如果无法将整个工作簿保存为pdf,那么打印整个工作簿是最佳选择,还是可能在C#中?以下是我到目前为止我只需要保存为pdf所以我可以发送电子邮件.谢谢您的帮助.
using Excel = Microsoft.Office.Interop.Excel; //Excel Reference
//Gets Excel and gets Activeworkbook and worksheet
Excel.Application oXL;
Excel.Workbook oWB;
Excel.Worksheet oSheet;
//Create New Instance in Excel
oXL = new Excel.Application();
oXL.Visible = true;
//Open Excel Workbook
oWB = oXL.Workbooks.Open("");
oWB = (Excel.Workbook)oXL.ActiveWorkbook;
oSheet = (Excel.Worksheet)oWB.ActiveSheet;
//Modify Excel Spreadsheet Based on Form
oSheet.Cells[6, 4] = maskedTextBox1.Text; //Change Value in Cell, Cell Location [y-axis, x-axis]
//Save Workbook As
oWB.SaveAs("");
//Save Workbook As PDF
//Close Workbook
oWB.Close("");
//Quit Excel
oXL.Quit();
Run Code Online (Sandbox Code Playgroud) 如何发送包含主题,附件,正文等的电子邮件.我在网站上查看过,他们提供的只是Visual Basic代码.我已经添加了参考:
using Microsoft.Office.Interop.Outlook;
Run Code Online (Sandbox Code Playgroud) 无论如何,如果不同的组合框中有某种文本或值,则禁用组合框.我尝试了几件事似乎无法让它发挥作用.
以下是示例

嘿,无论如何,在您的程序中,您可以在任何地方添加最小化/最大化图标.(如下).如果可能的话,我希望能够最小化和最大化某些部分.谢谢您的帮助.

无论如何都要替换文本框中的文本,例如见下文.我目前正在使用它,但似乎在VBA中效果不佳.
If TextBox6.Text.Contains("<GTOL-PERP>") Then
TextBox6.Text = TextBox6.Text.Replace("<GTOL-PERP>", "j")
End If
Run Code Online (Sandbox Code Playgroud)